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


Java MolecularData类代码示例

本文整理汇总了Java中mesquite.categ.lib.MolecularData的典型用法代码示例。如果您正苦于以下问题:Java MolecularData类的具体用法?Java MolecularData怎么用?Java MolecularData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MolecularData类属于mesquite.categ.lib包,在下文中一共展示了MolecularData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: alterBlockOfCharacters

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public boolean alterBlockOfCharacters(CharacterData data, int icStart, int icEnd) {
	if (data==null)
		return false; 
	if (data instanceof MolecularData){
		MolecularData mData = (MolecularData)data;
		mData.reverse(icStart, icEnd, true);
	}
	else {
		for (int it = 0; it< data.getNumTaxa(); it++)
			for (int i=0; i <= (icEnd-icStart)/2 && icStart+i< icEnd-i; i++) {  
				data.tradeStatesBetweenCharacters(icStart+i, icEnd-i, it,true);
			}
	}

	return true;
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:17,代码来源:ReverseSequence.java

示例2: getStringForTaxon

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public String getStringForTaxon(int it){
	String note = getNote(it,MolecularData.genBankNumberRef);
	if (note != null)
		return note;
	note = getNote(it,CharacterData.publicationCodeNameRef);
	if (note != null)
		return note;
	note = getNote(it,CharacterData.taxonMatrixNotesRef);
	if (note != null)
		return note;
	if (observedStates == null)
		doCalcs();
	if (bits ==null || it <0 || it > bits.getSize())
		return "?";
	if (bits.isBitOn(it))
		return "Yes";
	else
		return "No Data";
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:20,代码来源:TaxaListHasData.java

示例3: 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

示例4: 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

示例5: calculateNumber

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public void calculateNumber(MCharactersDistribution data, MesquiteNumber result, MesquiteString resultString) {
	if (result == null || data == null)
		return;
	clearResultAndLastResult(result);

	CharacterData parentData = data.getParentData();
	if (parentData == null){
		if (resultString != null)
			resultString.setValue("Average sequence length can be calculated only for stored matrices");
		return;
	}
	if (!(parentData instanceof MolecularData)){
		if (resultString != null)
			resultString.setValue("Average sequence length can be calculated only for molecular matrices");
		return;
	}
	int numTaxa = parentData.getNumTaxa();
	int numChars = parentData.getNumChars();
	
	int count = 0;
	for (int it=0; it<numTaxa; it++)
		for (int ic=0; ic<numChars; ic++)
			if (!parentData.isInapplicable(ic,  it))
				count ++;
	
	if (count>0) {
		result.setValue(count*1.0/numTaxa); 
	}  else
		result.setValue(0.0); 

	if (resultString!=null) {
		resultString.setValue("Average sequence length: " + result.toString());
	}
	saveLastResult(result);
	saveLastResultString(resultString);
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:37,代码来源:AvgSequenceLengthMatrix.java

示例6: alterBlockInTaxon

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public boolean alterBlockInTaxon(CharacterData data, int icStart, int icEnd, int it) {
	if (data==null)
		return false; 

	if (data instanceof MolecularData){
		MolecularData mData = (MolecularData)data;
		mData.reverse(icStart, icEnd, it, false, true);
	}
	else 
		for (int i=0; i <= (icEnd-icStart)/2 && icStart+i< icEnd-i; i++) {  
			data.tradeStatesBetweenCharacters(icStart+i, icEnd-i, it,true);
		}

	return true;
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:16,代码来源:ReverseSequence.java

示例7: cleanUpGenBankAssociatedObject

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
/** This method cleans up the confounded GenBank annotations of version 3.1 and earlier.  In those versions, the GenBank 
 * associated string included GenBank accession numbers and/or other details of sequence length, etc., appended in the 
 * TaxonListHadData module. After version 3.1, these were separated into different objects, in order to maintain the veracity
 * of the GenBank data.
 /*...................................................................................................................*/
void cleanUpGenBankAssociatedObject (Associable as, int whichTaxon, String genBankNote){
	String newNote="";
	while (!StringUtil.blank(genBankNote) && genBankNote.indexOf("(")>=0){
		int start = genBankNote.indexOf("(");
		int end = genBankNote.indexOf(")");
		String firstBit = "";
		if (start>0)
			firstBit = genBankNote.substring(0, start);
		newNote=genBankNote.substring(start,end+1);
		genBankNote = firstBit + genBankNote.substring(end+1, genBankNote.length());
	}
	 as.setAssociatedObject(MolecularData.genBankNumberRef, whichTaxon, genBankNote);
	 as.setAssociatedObject(CharacterData.taxonMatrixNotesRef, whichTaxon, newNote);
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:20,代码来源:ManageCharacters.java

示例8: integrateAlignment

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public boolean integrateAlignment(long[][] alignedMatrix, MolecularData data, int icStart, int icEnd, int itStart, int itEnd){
	if (alignedMatrix == null || data == null)
		return false;
	ownerModule.getProject().incrementProjectWindowSuppression();
	boolean success = AlignUtil.integrateAlignment(alignedMatrix, data,  icStart,  icEnd,  itStart,  itEnd);
	ownerModule.getProject().decrementProjectWindowSuppression();
	if (separateThread)
		calculationMonitor.calculationCompleted(this);  // TODO:  this should ideally be in the full control of the module
	return success;
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:11,代码来源:AlignMultipleSequencesMachine.java

示例9: AlignThread

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public AlignThread(MesquiteModule ownerModule, AlignMultipleSequencesMachine alignmentMachine, MultipleSequenceAligner aligner, MolecularData data, MesquiteTable table){
	this.aligner = aligner;
	this.ownerModule = ownerModule;
	this.alignmentMachine = alignmentMachine;
	this.data = data;
	this.table = table;
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:8,代码来源:AlignMultipleSequencesMachine.java

示例10: getContigBaseFromOriginalMatrixBase

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public int getContigBaseFromOriginalMatrixBase(int originalMatrixBase, int it) {
	if (editedData==null || contig==null)
		return originalMatrixBase;
	MolecularData originalData = ChromaseqUtil.getOriginalData(editedData);
	if (originalData==null)
		return originalMatrixBase;
	int trimmedBase = originalData.numValidStateOrUnassigned(0, originalMatrixBase, it)-1;  // how many trimmed bases are up to that point
	int contigBase = contig.getContigBaseFromTrimmedBase(trimmedBase);
	return contigBase;  //-startingAddedBeforeOriginalTrim
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:11,代码来源:ContigMapper.java

示例11: getContigMapper

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public static ContigMapper getContigMapper (MolecularData data, Contig contig, int it) {
	ContigMapper contigMapper = ChromaseqUtil.getContigMapperAssociated(data, it);
	if (contigMapper==null) {
		contigMapper = new ContigMapper(contig);
		ChromaseqUtil.setContigMapperAssociated(data, it, contigMapper);
	}
	return contigMapper;
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:9,代码来源:ContigMapper.java

示例12: checkContig

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public void checkContig(MolecularData editedData, int it, MesquiteModule ownerModule) {
	if (getContig()==null && ownerModule!=null) {
		Contig contig = 	ChromaseqUtil.getContig(editedData,it,ownerModule, false);
		if (contig!=null)
			setContig(contig);
	}
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:8,代码来源:ContigMapper.java

示例13: getBackgroundColorOfCell

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
/** Gets background color for cell for row ic.  Override it if you want to change the color from the default. */
public Color getBackgroundColorOfCell(int it, boolean selected){
	if (observedStates == null){
		doCalcs();
		if (observedStates==null)
			return null;
	}
	if (observedStates.getParentData() != null){
		captureCharacterDataFromObservedStates();

		Associable tInfo = data.getTaxaInfo(false);
		NameReference genBankColor = NameReference.getNameReference("genbankcolor");
		Object obj = tInfo.getAssociatedObject(genBankColor,  it);  //not saved to file
		if (obj instanceof Color)
			return (Color)obj;
	}
	if (bits ==null || it <0 || it > bits.getSize())
		return null;
	String genBankNote = getNote(it,MolecularData.genBankNumberRef);
	String publicationNote = getNote(it,CharacterData.publicationCodeNameRef);
	if (selected){
		if (bits.isBitOn(it))
			return ColorDistribution.darkGreen;
		else
			return ColorDistribution.darkRed;		
	}
	else if (bits.isBitOn(it)){
		if (StringUtil.blank(genBankNote) && StringUtil.blank(publicationNote))
			return ColorDistribution.veryLightGreen;
		if (StringUtil.notEmpty(genBankNote)){
			if(!("x".equalsIgnoreCase(genBankNote)))
				return ColorDistribution.lightBlueGray;
			return ColorDistribution.lightGreenYellow;
		} else  if (StringUtil.notEmpty(publicationNote)){
			if ( !("x".equalsIgnoreCase(publicationNote)))
				return ColorDistribution.veryVeryLightBlue;
		}
		return ColorDistribution.lightGreenYellow;

	}
	else {
		if (StringUtil.blank(genBankNote) && StringUtil.blank(publicationNote))
			return ColorDistribution.brown;
		if ( !("x".equalsIgnoreCase(genBankNote)))
			return Color.red;
		else if ( !("x".equalsIgnoreCase(publicationNote)))
			return Color.orange;
		return ColorDistribution.lightRed;
	}
}
 
开发者ID:MesquiteProject,项目名称:MesquiteCore,代码行数:51,代码来源:TaxaListHasData.java

示例14: setData

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public void setData(MolecularData data) {
	MolecularData editedData = ChromaseqUtil.getEditedData(data);
	this.editedData = editedData;
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:5,代码来源:ContigMapper.java

示例15: recalc

import mesquite.categ.lib.MolecularData; //导入依赖的package包/类
public void recalc(MolecularData editedData, int it) {
	setData(editedData);
	recalc(it);
}
 
开发者ID:MesquiteProject,项目名称:Chromaseq,代码行数:5,代码来源:ContigMapper.java


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