当前位置: 首页>>代码示例>>Java>>正文


Java MolecularData.getNumChars方法代码示例

本文整理汇总了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;  
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:20,代码来源:ContigMapper.java

示例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);
	}
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:20,代码来源:ContigMapper.java

示例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;

}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:53,代码来源:ContigMapper.java


注:本文中的mesquite.categ.lib.MolecularData.getNumChars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。