use of beast.evolution.datatype.Aminoacid in project beast2 by CompEvol.
the class Blosum62 method getEncodingOrder.
@Override
public int[] getEncodingOrder() {
Aminoacid dataType = new Aminoacid();
String codeMap = dataType.getCodeMap();
int[] codeMapNrs = new int[dataType.getStateCount()];
String encoding = "ARNDCQEGHILKMFPSTWYV";
for (int i = 0; i < dataType.getStateCount(); i++) {
codeMapNrs[i] = encoding.indexOf(codeMap.charAt(i));
}
return codeMapNrs;
}
use of beast.evolution.datatype.Aminoacid in project beast2 by CompEvol.
the class DataTypeDeEncodeTest method typestrings.
@Parameterized.Parameters
public static Collection<Object[]> typestrings() {
Base dAa = new Aminoacid();
Base dBi = new Binary();
Base dIn = new IntegerData();
Base dNt = new Nucleotide();
Base d2C = new TwoStateCovarion();
return Arrays.asList(new Object[][] { { dIn, "1,2,14,23,?", Arrays.asList(new Integer[] { 1, 2, 14, 23, -1 }) }, { dNt, "ACGTURYMWSKBDHVNX", Arrays.asList(new Integer[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }) }, { dBi, "01-?10", Arrays.asList(new Integer[] { 0, 1, 2, 3, 1, 0 }) }, { d2C, "01ABCD-?", Arrays.asList(new Integer[] { 0, 1, 2, 3, 4, 5, 6, 7 }) }, { dAa, "ACDEFGHIKLMNPQRSTVWY", Arrays.asList(new Integer[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }) } });
}
Aggregations