public void calculateNumber(Taxon taxon, MesquiteNumber result, MesquiteString resultString) {
   if (result == null) return;
   clearResultAndLastResult(result);
   Taxa taxa = taxon.getTaxa();
   int it = taxa.whichTaxonNumber(taxon);
   if (taxa != currentTaxa || observedStates == null) {
     observedStates = matrixSourceTask.getCurrentMatrix(taxa);
     currentTaxa = taxa;
   }
   if (observedStates == null || !(observedStates.getParentData() instanceof DNAData)) return;
   DNAData data = (DNAData) observedStates.getParentData();
   int count = data.getAminoAcidNumbers(it, ProteinData.TER, countEvenIfOthers.getValue());
   if (result != null) result.setValue(count);
   if (resultString != null)
     resultString.setValue(
         "Number of stop codons in taxon " + observedStates.getName() + ": " + count);
   saveLastResult(result);
   saveLastResultString(resultString);
 }
 /**
  * Called to provoke any necessary initialization. This helps prevent the module's intialization
  * queries to the user from happening at inopportune times (e.g., while a long chart calculation
  * is in mid-progress)
  */
 public void initialize(Taxa taxa) {
   currentTaxa = taxa;
   matrixSourceTask.initialize(currentTaxa);
 }
 public String getParameters() {
   return "Number of stops coded by nucleotides in taxon in matrix from: "
       + matrixSourceTask.getParameters();
 }