use of dr.evolution.sequence.Sequence in project beast-mcmc by beast-dev.
the class TraceCorrelationAssert method createAlignment.
protected void createAlignment(Object[][] taxa_sequence, DataType dataType) {
alignment = new SimpleAlignment();
alignment.setDataType(dataType);
// alignment.setDataType(Nucleotides.INSTANCE);
// 6, 17
taxa = new Taxon[taxa_sequence[0].length];
System.out.println("Taxon len = " + taxa_sequence[0].length);
System.out.println("Alignment len = " + taxa_sequence[1].length);
if (taxa_sequence.length > 2)
System.out.println("Date len = " + taxa_sequence[2].length);
for (int i = 0; i < taxa_sequence[0].length; i++) {
taxa[i] = new Taxon(taxa_sequence[0][i].toString());
if (taxa_sequence.length > 2) {
Date date = new Date((Double) taxa_sequence[2][i], Units.Type.YEARS, (Boolean) taxa_sequence[3][0]);
taxa[i].setDate(date);
}
//taxonList.addTaxon(taxon);
Sequence sequence = new Sequence(taxa_sequence[1][i].toString());
sequence.setTaxon(taxa[i]);
sequence.setDataType(dataType);
alignment.addSequence(sequence);
}
}
Aggregations