package jalview.json.binding.v1; import jalview.schemes.Blosum62ColourScheme; import jalview.schemes.BuriedColourScheme; import jalview.schemes.ColourSchemeI; import jalview.schemes.HelixColourScheme; import jalview.schemes.HydrophobicColourScheme; import jalview.schemes.NucleotideColourScheme; import jalview.schemes.PIDColourScheme; import jalview.schemes.PurinePyrimidineColourScheme; import jalview.schemes.RNAInteractionColourScheme; import jalview.schemes.StrandColourScheme; import jalview.schemes.TaylorColourScheme; import jalview.schemes.TurnColourScheme; import jalview.schemes.ZappoColourScheme; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class AlignmentPojo { private String svid = "1.0"; private List seqs = new ArrayList(); private List alignAnnotation = new ArrayList(); private List seqGroups = new ArrayList(); private List seqFeatures = new ArrayList(); HashMap appSettings = new HashMap(); public AlignmentPojo() { } public List getSeqs() { return seqs; } public void setSeqs(ArrayList seqs) { this.seqs = seqs; } public HashMap getAppSettings() { return appSettings; } public void setAppSettings(HashMap appSettings) { this.appSettings = appSettings; } public List getAlignAnnotation() { return alignAnnotation; } public void setAlignAnnotation( List alignAnnotation) { this.alignAnnotation = alignAnnotation; } public List getSeqGroups() { return seqGroups; } public void setSeqGroups(List seqGroups) { this.seqGroups = seqGroups; } public List getSeqFeatures() { return seqFeatures; } public void setSeqFeatures(List seqFeatures) { this.seqFeatures = seqFeatures; } public String getSvid() { return svid; } public void setGlobalColorScheme(String globalColorScheme) { for (JalviewBioJsColorSchemeMapper cs : JalviewBioJsColorSchemeMapper .values()) { if (cs.getJalviewName().equals(globalColorScheme)) { // this.globalColorScheme = cs.getBioJsName(); this.appSettings.put("globalColorScheme", cs.getBioJsName()); break; } } } public enum JalviewBioJsColorSchemeMapper { USER_DEFINED("User Defined", "user defined", null), NONE("None", "foo", null), CLUSTAL("Clustal", "clustal", null), ZAPPO("Zappo", "zappo", new ZappoColourScheme()), TAYLOR("Taylor", "taylor", new TaylorColourScheme()), NUCLEOTIDE("Nucleotide", "nucleotide", new NucleotideColourScheme()), PURINE_PYRIMIDINE( "Purine/Pyrimidine", "purine", new PurinePyrimidineColourScheme()), HELIX_PROPENCITY( "Helix Propensity", "helix", new HelixColourScheme()), TURN_PROPENSITY( "Turn Propensity", "turn", new TurnColourScheme()), STRAND_PROPENSITY( "Strand Propensity", "strand", new StrandColourScheme()), BURIED_INDEX( "Buried Index", "buried", new BuriedColourScheme()), HYDROPHOBIC( "Hydrophobic", "hydro", new HydrophobicColourScheme()), // The color types below are not yet supported by BioJs MSA viewer T_COFFE_SCORES("T-Coffee Scores", "T-Coffee Scores", null), RNA_INT_TYPE( "RNA Interaction type", "RNA Interaction type", new RNAInteractionColourScheme()), BLOSUM62("Blosum62", "Blosum62", new Blosum62ColourScheme()), RNA_HELICES( "RNA Helices", "RNA Helices", null), PERCENTAGE_IDENTITY( "% Identity", "pid", new PIDColourScheme()); private String jalviewName; private String bioJsName; private ColourSchemeI jvColourScheme; private JalviewBioJsColorSchemeMapper(String jalviewName, String bioJsName, ColourSchemeI jvColourScheme) { this.jalviewName = jalviewName; this.bioJsName = bioJsName; this.setJvColourScheme(jvColourScheme); } public String getJalviewName() { return jalviewName; } public String getBioJsName() { return bioJsName; } public ColourSchemeI getJvColourScheme() { return jvColourScheme; } public void setJvColourScheme(ColourSchemeI jvColourScheme) { this.jvColourScheme = jvColourScheme; } } }