本文整理汇总了Java中mesquite.categ.lib.MolecularData.getNumChars方法的典型用法代码示例。如果您正苦于以下问题:Java MolecularData.getNumChars方法的具体用法?Java MolecularData.getNumChars怎么用?Java MolecularData.getNumChars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mesquite.categ.lib.MolecularData
的用法示例。
在下文中一共展示了MolecularData.getNumChars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMatrixBaseFromContigBase
import mesquite.categ.lib.MolecularData; //导入方法依赖的package包/类
public int getMatrixBaseFromContigBase(int contigBase, int it) {
if (editedData==null || contig==null)
return contigBase;
int trimmedBase = contig.getTrimmedBaseFromContigBase(contigBase);
MolecularData originalData = ChromaseqUtil.getOriginalData(editedData);
int count =-1;
for (int ic=0; ic<=originalData.getNumChars(); ic++)
if (originalData.isValidStateOrUnassigned(ic,it)){
count++;
if (count==trimmedBase) { // we've found as many states as trimmedBases
break;
}
}
if (count>=0) {
MeristicData reverseRegistryData = ChromaseqUtil.getReverseRegistryData(editedData);
return reverseRegistryData.getState(count,it);
}
return contigBase;
}
示例2: calcEndTrim
import mesquite.categ.lib.MolecularData; //导入方法依赖的package包/类
public void calcEndTrim(int it) {
if (editedData==null)
return;
MolecularData originalData = ChromaseqUtil.getOriginalData(editedData);
int contigBase = numTrimmedFromStart-1;
int lastContigBaseInOriginal = -1;
for (int ic = 0; ic< originalData.getNumChars(); ic++){
if (originalData.isValidStateOrUnassigned(ic, it)){ // an original state is here!
contigBase++;
lastContigBaseInOriginal=contigBase;
}
}
int num = contig.getNumBases()-lastContigBaseInOriginal-1;
setNumTrimmedFromEnd(num);
for (int ic = 0; ic< num; ic++){
setDeletedBase(contig.getNumBases()-ic-1, true);
}
}
示例3: recalc
import mesquite.categ.lib.MolecularData; //导入方法依赖的package包/类
/** This method does the basic calculations to summarize various aspects of the added and deleted bases; it does not alter the core storage about which bases are deleted and how many are added.*/
public void recalc(int it) {
MolecularData originalData = ChromaseqUtil.getOriginalData(editedData);
MeristicData reverseRegistryData = ChromaseqUtil.getReverseRegistryData(editedData);
MeristicData registryData = ChromaseqUtil.getRegistryData(editedData);
// this.numTrimmedFromStart = numTrimmedFromStart;
int contigBase = numTrimmedFromStart-1;
int lastContigBaseInOriginal = -1;
int lastEditedBaseInOriginal = -1;
int deletedAtEnd = 0;
for (int ic = 0; ic< originalData.getNumChars(); ic++){
int positionInEdited = reverseRegistryData.getState(ic, it,0);
if (originalData.isValidStateOrUnassigned(ic, it)){ // an original state is here!
contigBase++;
if (getDeletedBase(contigBase)){
deletedAtEnd++;
}
else{ // is in edited, so reset deletedAtEnds
deletedAtEnd=0;
lastEditedBaseInOriginal = positionInEdited; // record last base in edited which corresponds to one in original
}
lastContigBaseInOriginal=contigBase;
}
}
int numFromEnd = numBases-lastContigBaseInOriginal-1;
setNumDeletedFromEnd(deletedAtEnd);
setNumTrimmedFromEnd(numFromEnd);
int addedBase=0;
int addedToEnd=0;
for (int ic = 0; ic< editedData.getNumChars(); ic++){
if (editedData.isValidStateOrUnassigned(ic, it)){ // a state is here in the edited data
int positionInOriginal = registryData.getState(ic, it);
if (positionInOriginal<0 || !registryData.isCombinable(ic, it) || !originalData.isValidStateOrUnassigned(positionInOriginal, it)){ // not in original!
addedBase++;
if (ic>=lastEditedBaseInOriginal)
addedToEnd++;
}
else { // it is in original; now record added bases
addedBase=0;
}
}
}
setNumAddedToEnd(addedToEnd);
recalcPart();
hasBeenSetUp = true;
}