575b697c9836ce3cbc48d1ae7e0c2f5ffdd1dcb4
[jalview.git] / src / jalview / json / binding / biojson / v1 / AlignmentPojo.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.json.binding.biojson.v1;
22
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27
28 import com.github.reinert.jjschema.Attributes;
29
30 @Attributes(
31   title = "BioJSON",
32   description = "A specification for the representation and exchange of bioinformatics data")
33 public class AlignmentPojo
34 {
35   @Attributes(
36     required = true,
37     description = "Serial version identifier for <b>BioJSON</b> schema")
38   private String svid = "1.0";
39
40   @Attributes(
41     required = true,
42     minItems = 1,
43     description = "An array of Sequences which makes up the Alignment")
44   private List<SequencePojo> seqs = new ArrayList<SequencePojo>();
45
46   @Attributes(
47     required = false,
48     minItems = 0,
49     exclusiveMaximum = true,
50     description = "Alignment annotations stores symbols and graphs usually rendered </br>"
51             + "below the alignment and often reflect properties of the alignment </br>as a whole.")
52   private List<AlignmentAnnotationPojo> alignAnnotation = new ArrayList<AlignmentAnnotationPojo>();
53
54   @Attributes(
55     required = false,
56     minItems = 0,
57     description = "A sequence group is a rectangular region of an alignment <br>bounded by startRes and endRes positions in the alignment <br>coordinate system for a set of sequences")
58   private List<SequenceGrpPojo> seqGroups = new ArrayList<SequenceGrpPojo>();
59
60   @Attributes(
61     required = false,
62     minItems = 0,
63     description = "Sequence features are properties of the individual sequences, <br>they do not change with the alignment, but are shown mapped<br> on to specific residues within the alignment")
64   private List<SequenceFeaturesPojo> seqFeatures = new ArrayList<SequenceFeaturesPojo>();
65
66   @Attributes(
67     required = false,
68     enums = { "None", "User Defined", "Clustal", "Zappo", "Taylor",
69         "Nucleotide", "Pyrimidine", "Purine", "Turn", "Helix", "Strand",
70         "Buried", "Hydro", "T-Coffee Scores", "RNA Interaction type",
71         "Blosum62", "RNA Helices", "% Identity" },
72     description = "The <a href=\"#colourScheme\">Colour Scheme</a> applied to the alignment")
73   private String colourScheme;
74
75   @Attributes(
76     required = true,
77     maxItems = 0,
78     description = "AppSettings stores key=value pairs of custom application specific <br>"
79             + "settings (i.e visualisation settings, etc) for different applications<br>"
80             + "that consume or generate BioJSON")
81   Map<String, Object> appSettings = new HashMap<String, Object>();
82
83   public AlignmentPojo()
84   {
85   }
86
87   public List<SequencePojo> getSeqs()
88   {
89     return seqs;
90   }
91
92   public void setSeqs(ArrayList<SequencePojo> seqs)
93   {
94     this.seqs = seqs;
95   }
96
97   public Map<String, Object> getAppSettings()
98   {
99     return appSettings;
100   }
101
102   public void setAppSettings(Map<String, Object> appSettings)
103   {
104     this.appSettings = appSettings;
105   }
106
107   public List<AlignmentAnnotationPojo> getAlignAnnotation()
108   {
109     return alignAnnotation;
110   }
111
112   public void setAlignAnnotation(
113           List<AlignmentAnnotationPojo> alignAnnotation)
114   {
115     this.alignAnnotation = alignAnnotation;
116   }
117
118   public List<SequenceGrpPojo> getSeqGroups()
119   {
120     return seqGroups;
121   }
122
123   public void setSeqGroups(List<SequenceGrpPojo> seqGroups)
124   {
125     this.seqGroups = seqGroups;
126   }
127
128   public List<SequenceFeaturesPojo> getSeqFeatures()
129   {
130     return seqFeatures;
131   }
132
133   public void setSeqFeatures(List<SequenceFeaturesPojo> seqFeatures)
134   {
135     this.seqFeatures = seqFeatures;
136   }
137
138   public String getSvid()
139   {
140     return svid;
141   }
142
143   public void setGlobalColorScheme(String globalColorScheme)
144   {
145     this.appSettings.put("globalColorScheme", globalColorScheme);
146   }
147
148   public String getColourScheme()
149   {
150     return colourScheme;
151   }
152
153   public void setColourScheme(String colourScheme)
154   {
155     this.colourScheme = colourScheme;
156   }
157
158 }