remove unnecessary import
[jalview.git] / src / jalview / datamodel / AlignmentI.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4 *
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.
9 *
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.
14 *
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
18 */
19 package jalview.datamodel;
20
21 import java.util.*;
22
23
24 /** Data structure to hold and manipulate a multiple sequence alignment
25  */
26 public interface AlignmentI
27 {
28     /**
29      *  Calculates the number of sequences in an alignment
30      *
31      * @return Number of sequences in alignment
32      */
33     public int getHeight();
34
35     /**
36      * Calculates the maximum width of the alignment, including gaps.
37      *
38      * @return Greatest sequence length within alignment.
39      */
40     public int getWidth();
41
42
43     /**
44      * Calculates if this set of sequences is all the same length
45      *
46      * @return true if all sequences in alignment are the same length
47      */
48     public boolean isAligned();
49
50     /**
51      * Gets sequences as a Vector
52      *
53      * @return All sequences in alignment.
54      */
55     public Vector getSequences();
56
57     /**
58      * Gets sequences as a SequenceI[]
59      *
60      * @return All sequences in alignment.
61      */
62     public SequenceI [] getSequencesArray();
63
64     /**
65      * Find a specific sequence in this alignment.
66      *
67      * @param i Index of required sequence.
68      *
69      * @return SequenceI at given index.
70      */
71     public SequenceI getSequenceAt(int i);
72
73     /**
74      * Add a new sequence to this alignment.
75      *
76      * @param seq New sequence will be added at end of alignment.
77      */
78     public void addSequence(SequenceI seq);
79
80     /**
81      * Used to set a particular index of the alignment with the given sequence.
82      *
83      * @param i Index of sequence to be updated.
84      * @param seq New sequence to be inserted.
85      */
86     public void setSequenceAt(int i, SequenceI seq);
87
88     /**
89      * Deletes a sequence from the alignment
90      *
91      * @param s Sequence to be deleted.
92      */
93     public void deleteSequence(SequenceI s);
94
95     /**
96      * Deletes a sequence from the alignment.
97      *
98      * @param i Index of sequence to be deleted.
99      */
100     public void deleteSequence(int i);
101
102
103     /**
104      * Finds sequence in alignment using sequence name as query.
105      *
106      * @param name Id of sequence to search for.
107      *
108      * @return Sequence matching query, if found. If not found returns null.
109      */
110     public SequenceI findName(String name);
111
112     public SequenceI [] findSequenceMatch(String name);
113
114     /**
115      * Finds index of a given sequence in the alignment.
116      *
117      * @param s Sequence to look for.
118      *
119      * @return Index of sequence within the alignment.
120      */
121     public int findIndex(SequenceI s);
122
123
124     /**
125      * Finds group that given sequence is part of.
126      *
127      * @param s Sequence in alignment.
128      *
129      * @return First group found for sequence. WARNING :
130      * Sequences may be members of several groups. This method is incomplete.
131      */
132     public SequenceGroup findGroup(SequenceI s);
133
134     /**
135      * Finds all groups that a given sequence is part of.
136      *
137      * @param s Sequence in alignment.
138      *
139      * @return All groups containing given sequence.
140      */
141     public SequenceGroup[] findAllGroups(SequenceI s);
142
143     /**
144      * Adds a new SequenceGroup to this alignment.
145      *
146      * @param sg New group to be added.
147      */
148     public void addGroup(SequenceGroup sg);
149
150     /**
151      * Deletes a specific SequenceGroup
152      *
153      * @param g Group will be deleted from alignment.
154      */
155     public void deleteGroup(SequenceGroup g);
156
157     /**
158      * Get all the groups associated with this alignment.
159      *
160      * @return All groups as a Vector.
161      */
162     public Vector getGroups();
163
164     /**
165      * Deletes all groups from this alignment.
166      */
167     public void deleteAllGroups();
168
169
170     /**
171      * Adds a new AlignmentAnnotation to this alignment
172      */
173     public void addAnnotation(AlignmentAnnotation aa);
174
175
176     public void setAnnotationIndex(AlignmentAnnotation aa, int index);
177
178     /**
179      * Deletes a specific AlignmentAnnotation from the alignment.
180      *
181      * @param aa DOCUMENT ME!
182      */
183     public void deleteAnnotation(AlignmentAnnotation aa);
184
185     /**
186      * DOCUMENT ME!
187      *
188      * @return DOCUMENT ME!
189      */
190     public AlignmentAnnotation[] getAlignmentAnnotation();
191
192     /**
193      * DOCUMENT ME!
194      *
195      * @param gc DOCUMENT ME!
196      */
197     public void setGapCharacter(char gc);
198
199     /**
200      * DOCUMENT ME!
201      *
202      * @return DOCUMENT ME!
203      */
204     public char getGapCharacter();
205
206
207     /**
208      * Returns true if alignment is nucleotide sequence
209      *
210      * @return DOCUMENT ME!
211      */
212     public boolean isNucleotide();
213
214     /**
215      * Set true if the alignment is a nucleotide sequence
216      *
217      * @return
218      */
219     public void setNucleotide(boolean b);
220
221
222     public Alignment getDataset();
223
224     public void setDataset(Alignment dataset);
225     /**
226      * pads sequences with gaps (to ensure the set looks like an alignment)
227      * @return boolean true if alignment was modified
228      */
229     public boolean padGaps();
230
231     public void adjustSequenceAnnotations();
232
233     public HiddenSequences getHiddenSequences();
234     /**
235      * Compact representation of alignment
236      * @return CigarArray
237      */
238     public CigarArray getCompactAlignment();
239 }