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();
187 * @param i DOCUMENT ME!
188 * @param j DOCUMENT ME!
190 public void deleteChars(int i, int j);
195 * @param i DOCUMENT ME!
196 * @param c DOCUMENT ME!
198 public void insertCharAt(int i, char c);
203 * @param i DOCUMENT ME!
204 * @param c DOCUMENT ME!
206 public void insertCharAt(int i, int length, char c);
211 * @return DOCUMENT ME!
213 public SequenceFeature[] getSequenceFeatures();
218 * @param v DOCUMENT ME!
220 public void setSequenceFeatures(SequenceFeature[] features);
225 * @param id DOCUMENT ME!
227 public void setPDBId(Vector ids);
232 * @return DOCUMENT ME!
234 public Vector getPDBId();
236 public void addPDBId(PDBEntry entry);
238 public String getVamsasId();
240 public void setVamsasId(String id);
242 public void setDBRef(DBRefEntry[] dbs);
244 public DBRefEntry[] getDBRef();
246 public void addDBRef(DBRefEntry entry);
248 public void addSequenceFeature(SequenceFeature sf);
250 public void deleteFeature(SequenceFeature sf);
252 public void setDatasetSequence(SequenceI seq);
254 public SequenceI getDatasetSequence();
256 public AlignmentAnnotation[] getAnnotation();
258 public void addAlignmentAnnotation(AlignmentAnnotation annotation);
261 * Derive a sequence (using this one's dataset or as the dataset)
262 * @return duplicate sequence with valid dataset sequence
264 public SequenceI deriveSequence();
266 * set the array of associated AlignmentAnnotation for this sequenceI
269 public void setAlignmentAnnotation(AlignmentAnnotation[] annotation);