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


Java MesquiteNumber.setValue方法代码示例

本文整理汇总了Java中mesquite.lib.MesquiteNumber.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java MesquiteNumber.setValue方法的具体用法?Java MesquiteNumber.setValue怎么用?Java MesquiteNumber.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mesquite.lib.MesquiteNumber的用法示例。


在下文中一共展示了MesquiteNumber.setValue方法的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);
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:23,代码来源:NumMatricesWithDataForTaxon.java

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

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

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


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