Debian Codegraph @

src/dr/app/beauti/alignmentviewer/ChemicalAminoAcidDecorator.java

raw symbols SCIP
1 /*
2 * ChemicalAminoAcidDecorator.java
3 *
4 * Copyright (c) 2002-2015 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.app.beauti.alignmentviewer;
27
28 import jebl.evolution.sequences.AminoAcids;
29
30 import java.awt.*;
31
32 /**
33 * @author Andrew Rambaut
34 * @version $Id: ChemicalAminoAcidDecorator.java,v 1.1 2005/11/11 16:40:41 rambaut Exp $
35 */
36 public class ChemicalAminoAcidDecorator implements StateDecorator {
37 Paint[] paints = new Paint[AminoAcids.getStateCount()];
38
39 public ChemicalAminoAcidDecorator() {
40 // Aliphatic
41 paints[AminoAcids.A_STATE.getIndex()] =
42 paints[AminoAcids.V_STATE.getIndex()] =
43 paints[AminoAcids.I_STATE.getIndex()] =
44 paints[AminoAcids.L_STATE.getIndex()] =
45 new Color(27, 4, 172);
46
47 // Phenylalanine
48 paints[AminoAcids.F_STATE.getIndex()] =
49 new Color(0, 204, 255);
50
51 // Sulphur
52 paints[AminoAcids.C_STATE.getIndex()] =
53 paints[AminoAcids.M_STATE.getIndex()] =
54 new Color(204, 236, 255);
55
56 //Glycine
57 paints[AminoAcids.G_STATE.getIndex()] =
58 new Color(0, 255, 0);
59
60 // Hydroxyl
61 paints[AminoAcids.S_STATE.getIndex()] =
62 paints[AminoAcids.T_STATE.getIndex()] =
63 new Color(137, 248, 139);
64
65 // Tryptophan
66 paints[AminoAcids.W_STATE.getIndex()] =
67 new Color(204, 153, 255);
68
69 // Tyrosine
70 paints[AminoAcids.Y_STATE.getIndex()] =
71 new Color(204, 255, 204);
72
73 // Proline
74 paints[AminoAcids.P_STATE.getIndex()] =
75 new Color(255, 255, 0);
76
77 // Acidic
78 paints[AminoAcids.D_STATE.getIndex()] =
79 paints[AminoAcids.E_STATE.getIndex()] =
80 new Color(255, 204, 0);
81
82 // Amide
83 paints[AminoAcids.N_STATE.getIndex()] =
84 paints[AminoAcids.Q_STATE.getIndex()] =
85 new Color(244, 165, 4);
86
87 // Basic
88 paints[AminoAcids.H_STATE.getIndex()] =
89 paints[AminoAcids.K_STATE.getIndex()] =
90 paints[AminoAcids.R_STATE.getIndex()] =
91 new Color(236, 21, 4);
92
93 paints[AminoAcids.B_STATE.getIndex()] = Color.DARK_GRAY;
94 paints[AminoAcids.Z_STATE.getIndex()] = Color.DARK_GRAY;
95 paints[AminoAcids.X_STATE.getIndex()] = Color.GRAY;
96 paints[AminoAcids.UNKNOWN_STATE.getIndex()] = Color.GRAY;
97 paints[AminoAcids.STOP_STATE.getIndex()] = Color.GRAY;
98 paints[AminoAcids.GAP_STATE.getIndex()] = Color.GRAY;
99 };
100
101 public Paint getStatePaint(int stateIndex) {
102 return paints[stateIndex];
103 }
104 }