Debian Codegraph @

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

raw symbols SCIP
1 /*
2 * HydropathyAminoAcidDecorator.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: HydropathyAminoAcidDecorator.java,v 1.1 2005/11/11 16:40:41 rambaut Exp $
35 */
36 public class HydropathyAminoAcidDecorator implements StateDecorator {
37 Paint[] paints = new Paint[AminoAcids.getStateCount()];
38
39 public HydropathyAminoAcidDecorator() {
40 // Hydropathic
41 paints[AminoAcids.I_STATE.getIndex()] =
42 paints[AminoAcids.V_STATE.getIndex()] =
43 paints[AminoAcids.L_STATE.getIndex()] =
44 paints[AminoAcids.F_STATE.getIndex()] =
45 paints[AminoAcids.C_STATE.getIndex()] =
46 paints[AminoAcids.M_STATE.getIndex()] =
47 paints[AminoAcids.A_STATE.getIndex()] =
48 paints[AminoAcids.W_STATE.getIndex()] = new Color(51, 102, 255);
49
50 // Neutral
51 paints[AminoAcids.G_STATE.getIndex()] =
52 paints[AminoAcids.T_STATE.getIndex()] =
53 paints[AminoAcids.S_STATE.getIndex()] =
54 paints[AminoAcids.Y_STATE.getIndex()] =
55 paints[AminoAcids.P_STATE.getIndex()] =
56 paints[AminoAcids.H_STATE.getIndex()] = new Color(255, 255, 0);
57
58 // Hydrophilic
59 paints[AminoAcids.D_STATE.getIndex()] =
60 paints[AminoAcids.E_STATE.getIndex()] =
61 paints[AminoAcids.K_STATE.getIndex()] =
62 paints[AminoAcids.N_STATE.getIndex()] =
63 paints[AminoAcids.Q_STATE.getIndex()] =
64 paints[AminoAcids.R_STATE.getIndex()] = new Color(230, 6, 6);
65
66 paints[AminoAcids.B_STATE.getIndex()] = Color.DARK_GRAY;
67 paints[AminoAcids.Z_STATE.getIndex()] = Color.DARK_GRAY;
68 paints[AminoAcids.X_STATE.getIndex()] = Color.GRAY;
69 paints[AminoAcids.UNKNOWN_STATE.getIndex()] = Color.GRAY;
70 paints[AminoAcids.STOP_STATE.getIndex()] = Color.GRAY;
71 paints[AminoAcids.GAP_STATE.getIndex()] = Color.GRAY;
72 };
73
74 public Paint getStatePaint(int stateIndex) {
75 return paints[stateIndex];
76 }
77 }