本文整理汇总了Java中dr.evolution.alignment.Alignment.getTaxonCount方法的典型用法代码示例。如果您正苦于以下问题:Java Alignment.getTaxonCount方法的具体用法?Java Alignment.getTaxonCount怎么用?Java Alignment.getTaxonCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dr.evolution.alignment.Alignment
的用法示例。
在下文中一共展示了Alignment.getTaxonCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simulateMsatPattern
import dr.evolution.alignment.Alignment; //导入方法依赖的package包/类
/**
* Convert an alignment to a pattern
*/
public Patterns simulateMsatPattern(){
Alignment align = simulate();
int[] pattern = new int[align.getTaxonCount()];
for(int i = 0; i < pattern.length; i++){
String taxonName = align.getSequence(i).getTaxon().getId();
int index = taxa.getTaxonIndex(taxonName);
pattern[index] = Integer.parseInt(align.getSequence(i).getSequenceString());
}
Patterns patterns = new Patterns(dataType,taxa);
patterns.addPattern(pattern);
for(int i = 0; i < pattern.length;i++){
System.out.print(pattern[i]+",");
}
System.out.println();
return patterns;
}
示例2: writeAlignment
import dr.evolution.alignment.Alignment; //导入方法依赖的package包/类
/**
* Generate an alignment block from these beast options
*
* @param alignment the alignment to write
* @param writer the writer
*/
private void writeAlignment(Alignment alignment, XMLWriter writer) {
writer.writeText("");
writer.writeComment("The sequence alignment (each sequence refers to a taxon above).",
"ntax=" + alignment.getTaxonCount() + " nchar=" + alignment.getSiteCount());
if (options.samplePriorOnly) {
writer.writeComment("Null sequences generated in order to sample from the prior only.");
}
if (getAlignmentDataTypeDescription(alignment) != null) {
writer.writeOpenTag(
AlignmentParser.ALIGNMENT,
new Attribute[]{
new Attribute.Default<String>(XMLParser.ID, alignment.getId()),
new Attribute.Default<String>(DataType.DATA_TYPE, getAlignmentDataTypeDescription(alignment))
}
);
} else {
writer.writeOpenTag(
AlignmentParser.ALIGNMENT, new Attribute.Default<String>(XMLParser.ID, alignment.getId()));
writer.writeIDref(DataType.DATA_TYPE, getAlignmentDataTypeIdref(alignment));
}
for (int i = 0; i < alignment.getTaxonCount(); i++) {
Taxon taxon = alignment.getTaxon(i);
writer.writeOpenTag(SequenceParser.SEQUENCE);
writer.writeIDref(TaxonParser.TAXON, taxon.getId());
if (!options.samplePriorOnly) {
// writer.checkText(alignment.getAlignedSequenceString(i));
writer.writeText(alignment.getAlignedSequenceString(i));
// System.out.println(taxon.getId() + ": \n" + alignment.getAlignedSequenceString(i));
// System.out.println("len = " + alignment.getAlignedSequenceString(i).length() + "\n");
} else {
// generate a codon in case there is codon partitioning
writer.writeText(NULL_SEQUENCE);
}
writer.writeCloseTag(SequenceParser.SEQUENCE);
}
writer.writeCloseTag(AlignmentParser.ALIGNMENT);
}
示例3: writeAlignment
import dr.evolution.alignment.Alignment; //导入方法依赖的package包/类
/**
* Generate an alignment block from these beast options
*
* @param alignment the alignment to write
* @param writer the writer
*/
private void writeAlignment(Alignment alignment, XMLWriter writer) {
writer.writeText("");
writer.writeComment("The sequence alignment (each sequence refers to a taxon above).",
"ntax=" + alignment.getTaxonCount() + " nchar=" + alignment.getSiteCount());
if (options.samplePriorOnly) {
writer.writeComment("Null sequences generated in order to sample from the prior only.");
}
if (getAlignmentDataTypeDescription(alignment) != null) {
writer.writeOpenTag(
AlignmentParser.ALIGNMENT,
new Attribute[]{
new Attribute.Default<String>(XMLParser.ID, alignment.getId()),
new Attribute.Default<String>(DataType.DATA_TYPE, getAlignmentDataTypeDescription(alignment))
}
);
} else {
writer.writeOpenTag(
AlignmentParser.ALIGNMENT, new Attribute.Default<String>(XMLParser.ID, alignment.getId()));
writer.writeIDref(DataType.DATA_TYPE, getAlignmentDataTypeIdref(alignment));
}
for (int i = 0; i < alignment.getTaxonCount(); i++) {
Taxon taxon = alignment.getTaxon(i);
writer.writeOpenTag(SequenceParser.SEQUENCE);
writer.writeIDref(TaxonParser.TAXON, taxon.getId());
if (!options.samplePriorOnly) {
// writer.checkText(alignment.getAlignedSequenceString(i));
writer.writeText(alignment.getAlignedSequenceString(i));
// System.out.println(taxon.getId() + ": \n" + alignment.getAlignedSequenceString(i));
// System.out.println("len = " + alignment.getAlignedSequenceString(i).length() + "\n");
} else {
// generate a codon in case there is codon partitioning
writer.writeText("NNN");
}
writer.writeCloseTag(SequenceParser.SEQUENCE);
}
writer.writeCloseTag(AlignmentParser.ALIGNMENT);
}