本文整理汇总了Java中mesquite.lib.MesquiteNumber类的典型用法代码示例。如果您正苦于以下问题:Java MesquiteNumber类的具体用法?Java MesquiteNumber怎么用?Java MesquiteNumber使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MesquiteNumber类属于mesquite.lib包,在下文中一共展示了MesquiteNumber类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateNumber
import mesquite.lib.MesquiteNumber; //导入依赖的package包/类
public void calculateNumber(Taxon taxon, MesquiteNumber result, MesquiteString resultString){
if (result==null)
return;
result.setToUnassigned();
Taxa taxa = taxon.getTaxa();
int it = taxon.getIndex();
clearResultAndLastResult(result);
int count = 0;
for (int im = 0; im < getProject().getNumberCharMatrices(taxa); im++){
CharacterData data = getProject().getCharacterMatrix(taxa, im);
if (data.hasDataForTaxon(it)){
count++;
}
}
result.setValue(count);
if (resultString!=null){
resultString.setValue(result.toString());
}
saveLastResult(result);
saveLastResultString(resultString);
}
示例2: calculateNumber
import mesquite.lib.MesquiteNumber; //导入依赖的package包/类
public void calculateNumber(Taxon taxon, MesquiteNumber result, MesquiteString resultString){
if (result==null)
return;
result.setToUnassigned();
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)
return;
DNAData data = (DNAData)observedStates.getParentData();
result.setValue(0);
if (data!=null) {
AceFile ace = AceFile.getAceFile(this, data, it);
if (ace!=null)
result.setValue(ace.getNumReads());
}
if (resultString!=null)
resultString.setValue("Number of reads "+ observedStates.getName() + ": " + result.toString());
saveLastResult(result);
saveLastResultString(resultString);
}
示例3: calculateNumber
import mesquite.lib.MesquiteNumber; //导入依赖的package包/类
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)
return;
DNAData data = (DNAData)observedStates.getParentData();
CharInclusionSet inclusion = null;
if (data !=null)
inclusion = (CharInclusionSet)data.getCurrentSpecsSet(CharInclusionSet.class);
int numChars = observedStates.getNumChars();
int charExc = 0;
int tot = 0;
int count = 0;
double value = 0.0;
if (numChars != 0) {
for (int ic = 0; ic<data.getNumChars(); ic++) {
if (inclusion == null || inclusion.isBitOn(ic)){
long s = data.getState(ic,it);
if (!CategoricalState.isUnassigned(s) && !CategoricalState.isInapplicable(s)) {
if (s == A || s == T || s == AT) //monomorphic A or T or A&T or uncertain A or T
tot++;
else if (s == C || s == G || s == CG) { //monomorphic C or G or C&G or uncertain C or G
tot++;
count++;
}
}
} else
charExc++;
}
if (tot == 0)
value = 0;
else
value = ((double)count)/tot;
result.setValue(value);
}
String exs = "";
if (charExc > 0)
exs = " (" + Integer.toString(charExc) + " characters excluded)";
if (resultString!=null)
resultString.setValue("Proportion of CG in taxon "+ observedStates.getName() + exs + ": " + result.toString());
saveLastResult(result);
saveLastResultString(resultString);
}
示例4: calculateNumber
import mesquite.lib.MesquiteNumber; //导入依赖的package包/类
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)
return;
DNAData data = (DNAData)observedStates.getParentData();
CharInclusionSet inclusion = null;
if (data !=null)
inclusion = (CharInclusionSet)data.getCurrentSpecsSet(CharInclusionSet.class);
int numChars = observedStates.getNumChars();
int charExc = 0;
int tot = 0;
int count = 0;
double value = 0.0;
if (numChars != 0) {
for (int ic = 0; ic<data.getNumChars(); ic++) {
if (inclusion == null || inclusion.isBitOn(ic)){
long s = data.getState(ic,it);
if (!CategoricalState.isUnassigned(s) && !CategoricalState.isInapplicable(s)) {
if (s == A || s == T || s == AT) //monomorphic A or T or A&T or uncertain A or T
tot++;
else if (s == C || s == G || s == CG) { //monomorphic C or G or C&G or uncertain C or G
tot++;
count++;
}
}
} else
charExc++;
}
if (tot == 0)
value = MesquiteDouble.unassigned; //changed from 0, 26 jan '14
else
value = ((double)count)/tot;
result.setValue(value);
}
String exs = "";
if (charExc > 0)
exs = " (" + Integer.toString(charExc) + " characters excluded)";
if (resultString!=null)
resultString.setValue("Proportion of CG in taxon "+ observedStates.getName() + exs + ": " + result.toString());
saveLastResult(result);
saveLastResultString(resultString);
}