sequences are private in SequenceGroup
[jalview.git] / src / jalview / datamodel / AlignmentI.java
index 8a14a08..dbf3c35 100755 (executable)
@@ -23,94 +23,261 @@ import java.util.*;
 \r
 /** Data structure to hold and manipulate a multiple sequence alignment\r
  */\r
-public interface AlignmentI {\r
+public interface AlignmentI\r
+{\r
+    /**\r
+     *  Calculates the number of sequences in an alignment\r
+     *\r
+     * @return Number of sequences in alignment\r
+     */\r
     public int getHeight();\r
 \r
+    /**\r
+     * Calculates the maximum width of the alignment, including gaps.\r
+     *\r
+     * @return Greatest sequence length within alignment.\r
+     */\r
     public int getWidth();\r
 \r
+    /**\r
+     * Calculates the longest sequence Id of the alignment\r
+     *\r
+     * @return Number of characters in longest sequence Id.\r
+     */\r
     public int getMaxIdLength();\r
 \r
+    /**\r
+     * Calculates if this set of sequences is all the same length\r
+     *\r
+     * @return true if all sequences in alignment are the same length\r
+     */\r
     public boolean isAligned();\r
 \r
+    /**\r
+     * Gets sequences as a Vector\r
+     *\r
+     * @return All sequences in alignment.\r
+     */\r
     public Vector getSequences();\r
 \r
+    /**\r
+     * Gets sequences as a SequenceI[]\r
+     *\r
+     * @return All sequences in alignment.\r
+     */\r
+    public SequenceI [] getSequencesArray();\r
+\r
+    /**\r
+     * Find a specific sequence in this alignment.\r
+     *\r
+     * @param i Index of required sequence.\r
+     *\r
+     * @return SequenceI at given index.\r
+     */\r
     public SequenceI getSequenceAt(int i);\r
 \r
+    /**\r
+     * Add a new sequence to this alignment.\r
+     *\r
+     * @param seq New sequence will be added at end of alignment.\r
+     */\r
     public void addSequence(SequenceI seq);\r
 \r
+    /**\r
+     * Used to set a particular index of the alignment with the given sequence.\r
+     *\r
+     * @param i Index of sequence to be updated.\r
+     * @param seq New sequence to be inserted.\r
+     */\r
     public void setSequenceAt(int i, SequenceI seq);\r
 \r
+    /**\r
+     * Deletes a sequence from the alignment.\r
+     *\r
+     * @param s Sequence to be deleted.\r
+     */\r
     public void deleteSequence(SequenceI s);\r
 \r
+    /**\r
+     * Deletes a sequence from the alignment.\r
+     *\r
+     * @param i Index of sequence to be deleted.\r
+     */\r
     public void deleteSequence(int i);\r
 \r
-    public SequenceI[] getColumns(int start, int end);\r
-\r
-    public SequenceI[] getColumns(int seq1, int seq2, int start, int end);\r
-\r
+    /**\r
+     * Deletes all residues in every sequence of alignment within given columns.\r
+     *\r
+     * @param start Start index of columns to delete.\r
+     * @param end End index to columns to delete.\r
+     */\r
     public void deleteColumns(int start, int end);\r
 \r
+    /**\r
+     * Deletes all residues in every sequence of alignment within given columns.\r
+     *\r
+     * @param seq1 Index of first sequence to delete columns from.\r
+     * @param seq2 Index of last sequence to delete columns from.\r
+     * @param start Start index of columns to delete.\r
+     * @param end End index of columns to delete.\r
+     */\r
     public void deleteColumns(int seq1, int seq2, int start, int end);\r
 \r
-    public void insertColumns(SequenceI[] seqs, int pos);\r
-\r
+    /**\r
+     * Finds sequence in alignment using sequence name as query.\r
+     *\r
+     * @param name Id of sequence to search for.\r
+     *\r
+     * @return Sequence matching query, if found. If not found returns null.\r
+     */\r
     public SequenceI findName(String name);\r
 \r
-    public SequenceI findbyDisplayId(String name);\r
 \r
+    /**\r
+     * Finds index of a given sequence in the alignment.\r
+     *\r
+     * @param s Sequence to look for.\r
+     *\r
+     * @return Index of sequence within the alignment.\r
+     */\r
     public int findIndex(SequenceI s);\r
 \r
-    // Modifying\r
+    /**\r
+    * All sequences will be cut from beginning to given index.\r
+    *\r
+    * @param i Remove all residues in sequences up to this column.\r
+     */\r
     public void trimLeft(int i);\r
 \r
+    /**\r
+     * All sequences will be cut from given index.\r
+     *\r
+     * @param i Remove all residues in sequences beyond this column.\r
+     */\r
     public void trimRight(int i);\r
 \r
+    /**\r
+     * Removes all columns containing entirely gap characters.\r
+     */\r
     public void removeGaps();\r
 \r
-    public Vector removeRedundancy(float threshold, Vector sel);\r
 \r
-    // Grouping methods\r
-    public SequenceGroup findGroup(int i);\r
 \r
+    /**\r
+     * Finds group that given sequence is part of.\r
+     *\r
+     * @param s Sequence in alignment.\r
+     *\r
+     * @return First group found for sequence. WARNING :\r
+     * Sequences may be members of several groups. This method is incomplete.\r
+     */\r
     public SequenceGroup findGroup(SequenceI s);\r
 \r
+    /**\r
+     * Finds all groups that a given sequence is part of.\r
+     *\r
+     * @param s Sequence in alignment.\r
+     *\r
+     * @return All groups containing given sequence.\r
+     */\r
     public SequenceGroup[] findAllGroups(SequenceI s);\r
 \r
-    public void addToGroup(SequenceGroup g, SequenceI s);\r
-\r
-    public void removeFromGroup(SequenceGroup g, SequenceI s);\r
-\r
+    /**\r
+     * Adds a new SequenceGroup to this alignment.\r
+     *\r
+     * @param sg New group to be added.\r
+     */\r
     public void addGroup(SequenceGroup sg);\r
 \r
+    /**\r
+     * Deletes a specific SequenceGroup\r
+     *\r
+     * @param g Group will be deleted from alignment.\r
+     */\r
     public void deleteGroup(SequenceGroup g);\r
 \r
+    /**\r
+     * Get all the groups associated with this alignment.\r
+     *\r
+     * @return All groups as a Vector.\r
+     */\r
     public Vector getGroups();\r
 \r
+    /**\r
+     * Deletes all groups from this alignment.\r
+     */\r
     public void deleteAllGroups();\r
 \r
-    public void addSuperGroup(SuperGroup sg);\r
 \r
-    public void removeSuperGroup(SuperGroup sg);\r
-\r
-    public SuperGroup getSuperGroup(SequenceGroup sg);\r
-\r
-    // Sorting\r
-    public void sortGroups();\r
-\r
-    public void sortByPID(SequenceI s);\r
+    /**\r
+     * Adds a new AlignmentAnnotation to this alignment\r
+     */\r
+    public void addAnnotation(AlignmentAnnotation aa);\r
 \r
-    public void sortByID();\r
 \r
-    //Annotations\r
-    public void addAnnotation(AlignmentAnnotation aa);\r
+    public void setAnnotationIndex(AlignmentAnnotation aa, int index);\r
 \r
+    /**\r
+     * Deletes a specific AlignmentAnnotation from the alignment.\r
+     *\r
+     * @param aa DOCUMENT ME!\r
+     */\r
     public void deleteAnnotation(AlignmentAnnotation aa);\r
 \r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
     public AlignmentAnnotation[] getAlignmentAnnotation();\r
 \r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @param gc DOCUMENT ME!\r
+     */\r
     public void setGapCharacter(char gc);\r
 \r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
     public char getGapCharacter();\r
 \r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
     public Vector getAAFrequency();\r
+\r
+    /**\r
+     * Returns true if alignment is nucleotide sequence\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public boolean isNucleotide();\r
+\r
+    /**\r
+     * Set true if the alignment is a nucleotide sequence\r
+     *\r
+     * @return\r
+     */\r
+    public void setNucleotide(boolean b);\r
+\r
+\r
+    public Alignment getDataset();\r
+\r
+    public void setDataset(Alignment dataset);\r
+    /**\r
+     * pads sequences with gaps (to ensure the set looks like an alignment)\r
+     * @return boolean true if alignment was modified\r
+     */\r
+    public boolean padGaps();\r
+\r
+    public void adjustSequenceAnnotations();\r
+\r
+    public HiddenSequences getHiddenSequences();\r
+\r
 }\r