Debian Codegraph @

src/dr/oldevomodel/substmodel/AminoAcidModelType.java

raw symbols SCIP
1 /*
2 * AminoAcidModelType.java
3 *
4 * Copyright (c) 2002-2016 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.oldevomodel.substmodel;
27
28 import dr.util.Citation;
29
30 /**
31 * @author Alexei Drummond
32 */
33 public enum AminoAcidModelType {
34
35 BLOSUM_62("Blosum62", "blosum62", Blosum62.INSTANCE),
36 DAYHOFF("Dayhoff", "dayhoff", Dayhoff.INSTANCE),
37 JTT("JTT", dr.oldevomodel.substmodel.JTT.INSTANCE),
38 MT_REV_24("mtREV", MTREV.INSTANCE),
39 CP_REV_45("cpREV", CPREV.INSTANCE),
40 WAG("WAG", dr.oldevomodel.substmodel.WAG.INSTANCE),
41 LG("LG", dr.oldevomodel.substmodel.LG.INSTANCE),
42 FLU("FLU", dr.oldevomodel.substmodel.FLU.INSTANCE);
43
44 AminoAcidModelType(String displayName, EmpiricalRateMatrix matrix) {
45 this(displayName, displayName, matrix);
46 }
47
48 AminoAcidModelType(String displayName, String xmlName, EmpiricalRateMatrix matrix) {
49 this.displayName = displayName;
50 this.xmlName = xmlName;
51 this.matrix = matrix;
52 }
53
54 public String toString() {
55 return displayName;
56 }
57
58
59 public String getXMLName() {
60 return xmlName;
61 }
62
63 public EmpiricalRateMatrix getRateMatrixInstance() {
64 return matrix;
65 }
66
67 public Citation getCitation() {
68 return matrix.getCitations().get(0);
69 }
70
71 public static String[] xmlNames() {
72
73 AminoAcidModelType[] values = values();
74
75 String[] xmlNames = new String[values.length];
76 for (int i = 0; i < values.length; i++) {
77 xmlNames[i] = values[i].getXMLName();
78 }
79 return xmlNames;
80 }
81
82 private final String displayName, xmlName;
83 private final EmpiricalRateMatrix matrix;
84 }