Package jgromacs.data
Class Alignment
java.lang.Object
jgromacs.data.Alignment
- All Implemented Interfaces:
Cloneable
Objects of this class represent a sequence alignment
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSequence
(Sequence seq) Adds a new sequence to the alignmentclone()
Returns an identical Alignment objectboolean
Returns true if the two alignments are identicalReturns the collapsed alignment in which only the match columns are included (i.e.Returns the (majority) consensus sequence of the alignmentReturns the list of match position index sets (i.e.getMatchPositionIndices
(int i) Returns the set of position indices in sequence #i that are included in the match columns of alignmentReturns the list of match position indices in sequence #i as an ArrayList objectint
Returns the length of the longest sequence in the alignmentint
Returns the length of the shortest sequence in the alignmentgetMostFrequentResidueType
(int i) Returns the most frequent residue type in column #i of the alignmentint
Returns the number of sequences in the alignmentgetSequence
(int i) Returns sequence #i of the alignmentReturns sequences of the alignment as an ArrayList objectint
hashCode()
Returns hash codeboolean
isMatchColumn
(int i) Returns true if column #i is a match column (i.e.void
removeColumn
(int i) Removes column #i from the alignmentvoid
removeSequence
(int i) Removes sequence #i from the alignmentvoid
removeSequence
(Sequence seq) Removes the given sequence from the alignmentvoid
setSequence
(int i, Sequence seq) Replaces sequence #i of the alignment with a new sequencetoString()
Returns the String representation of alignmentReturns summary information about the alignment
-
Constructor Details
-
Alignment
public Alignment()Constructs a new Alignment object
-
-
Method Details
-
getSequence
Returns sequence #i of the alignment- Returns:
- sequence #i
-
getSequencesAsArrayList
Returns sequences of the alignment as an ArrayList object- Returns:
- list of sequences as an ArrayList
-
getNumberOfSequences
public int getNumberOfSequences()Returns the number of sequences in the alignment- Returns:
- number of sequences
-
getMaxSequenceLength
public int getMaxSequenceLength()Returns the length of the longest sequence in the alignment- Returns:
- length of longest sequence
-
getMinSequenceLength
public int getMinSequenceLength()Returns the length of the shortest sequence in the alignment- Returns:
- length of shortest sequence
-
addSequence
Adds a new sequence to the alignment- Parameters:
seq
- new sequence
-
setSequence
Replaces sequence #i of the alignment with a new sequence- Parameters:
seq
- new sequence
-
removeSequence
public void removeSequence(int i) Removes sequence #i from the alignment -
removeSequence
Removes the given sequence from the alignment- Parameters:
seq
- the sequence to be removed
-
removeColumn
public void removeColumn(int i) Removes column #i from the alignment -
isMatchColumn
public boolean isMatchColumn(int i) Returns true if column #i is a match column (i.e. there is no gap in column #i of the alignment) -
getCollapsedAlignment
Returns the collapsed alignment in which only the match columns are included (i.e. the columns without gaps)- Returns:
- collapsed alignment
-
getMatchPositionIndices
Returns the set of position indices in sequence #i that are included in the match columns of alignment- Returns:
- index set of match positions
-
getMatchPositionIndexSets
Returns the list of match position index sets (i.e. match position index group of each sequence in the alignment)- Returns:
- list of match positions index set
-
getMatchPositionIndicesAsArrayList
Returns the list of match position indices in sequence #i as an ArrayList object- Returns:
- ArrayList of match positions
-
getMostFrequentResidueType
Returns the most frequent residue type in column #i of the alignment- Returns:
- most frequent residue type
-
getConsensusSequence
Returns the (majority) consensus sequence of the alignment- Returns:
- consensus sequence
-
toString
Returns the String representation of alignment -
toStringInfo
Returns summary information about the alignment- Returns:
- summary information
-
clone
Returns an identical Alignment object -
equals
Returns true if the two alignments are identical -
hashCode
public int hashCode()Returns hash code
-