2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.datamodel;
29 public interface SequenceI
34 * @param name DOCUMENT ME!
36 public void setName(String name);
41 * @return DOCUMENT ME!
43 public String getName();
48 * @param start DOCUMENT ME!
50 public void setStart(int start);
55 * @return DOCUMENT ME!
57 public int getStart();
62 * @return DOCUMENT ME!
64 public String getDisplayId(boolean jvsuffix);
69 * @param end DOCUMENT ME!
71 public void setEnd(int end);
76 * @return DOCUMENT ME!
83 * @return DOCUMENT ME!
85 public int getLength();
90 * @param sequence DOCUMENT ME!
92 public void setSequence(String sequence);
97 * @return DOCUMENT ME!
99 public String getSequenceAsString();
104 * @param start DOCUMENT ME!
105 * @param end DOCUMENT ME!
107 * @return DOCUMENT ME!
109 public String getSequenceAsString(int start, int end);
114 * @return DOCUMENT ME!
116 public char[] getSequence();
121 * @param start DOCUMENT ME!
122 * @param end DOCUMENT ME!
124 * @return DOCUMENT ME!
126 public char[] getSequence(int start, int end);
129 * create a new sequence object from start to end of this sequence
134 public SequenceI getSubSequence(int start, int end);
139 * @param i DOCUMENT ME!
141 * @return DOCUMENT ME!
143 public char getCharAt(int i);
148 * @param desc DOCUMENT ME!
150 public void setDescription(String desc);
155 * @return DOCUMENT ME!
157 public String getDescription();
162 * @param pos DOCUMENT ME!
164 * @return DOCUMENT ME!
166 public int findIndex(int pos);
169 * Returns the sequence position for an alignment position
171 * @param i column index in alignment (from 1)
173 * @return residue number for residue (left of and) nearest ith column
175 public int findPosition(int i);
178 * Returns an int array where indices correspond to each residue in the sequence and the element value gives its position in the alignment
180 * @return int[SequenceI.getEnd()-SequenceI.getStart()+1] or null if no residues in SequenceI object
182 public int[] gapMap();
185 * Delete a range of aligned sequence columns, creating a new dataset sequence if necessary
186 * and adjusting start and end positions accordingly.
188 * @param i first column in range to delete
189 * @param j last column in range to delete
191 public void deleteChars(int i, int j);
196 * @param i DOCUMENT ME!
197 * @param c DOCUMENT ME!
199 public void insertCharAt(int i, char c);
204 * @param i DOCUMENT ME!
205 * @param c DOCUMENT ME!
207 public void insertCharAt(int i, int length, char c);
212 * @return DOCUMENT ME!
214 public SequenceFeature[] getSequenceFeatures();
219 * @param v DOCUMENT ME!
221 public void setSequenceFeatures(SequenceFeature[] features);
226 * @param id DOCUMENT ME!
228 public void setPDBId(Vector ids);
233 * @return DOCUMENT ME!
235 public Vector getPDBId();
237 public void addPDBId(PDBEntry entry);
239 public String getVamsasId();
241 public void setVamsasId(String id);
243 public void setDBRef(DBRefEntry[] dbs);
245 public DBRefEntry[] getDBRef();
248 * add the given entry to the list of DBRefs for this sequence,
249 * or replace a similar one if entry contains a map object
250 * and the existing one doesnt.
253 public void addDBRef(DBRefEntry entry);
255 public void addSequenceFeature(SequenceFeature sf);
257 public void deleteFeature(SequenceFeature sf);
259 public void setDatasetSequence(SequenceI seq);
261 public SequenceI getDatasetSequence();
263 public AlignmentAnnotation[] getAnnotation();
265 public void addAlignmentAnnotation(AlignmentAnnotation annotation);
267 public void removeAlignmentAnnotation(AlignmentAnnotation annotation);
270 * Derive a sequence (using this one's dataset or as the dataset)
271 * @return duplicate sequence with valid dataset sequence
273 public SequenceI deriveSequence();
275 * set the array of associated AlignmentAnnotation for this sequenceI
278 public void setAlignmentAnnotation(AlignmentAnnotation[] annotation);
280 * Get one or more alignment annotations with a particular label.
281 * @param label string which each returned annotation must have as a label.
282 * @return null or array of annotations.
284 public AlignmentAnnotation[] getAnnotation(String label);