Package org.biojava.bio.alignment
Class AlignmentPair
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.symbol.AbstractSymbolList
org.biojava.bio.alignment.SimpleAlignment
org.biojava.bio.alignment.AlignmentPair
- All Implemented Interfaces:
Serializable
,Alignment
,SymbolList
,Changeable
This class stores the result of an alignment procedure that creates a
pairwise alignment of two sequences. Currently, these sequences must have the
identical length (this may be changed in the future). A format routine
produces a BLAST-like output for the sequences but all necessary information
to visualize the alignment are contained in this class.
- Author:
- Andreas Dräger
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.biojava.bio.symbol.AbstractSymbolList
AbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslater
Nested classes/interfaces inherited from interface org.biojava.bio.alignment.Alignment
Alignment.SymbolListIterator
-
Field Summary
Fields inherited from interface org.biojava.bio.symbol.SymbolList
EDIT, EMPTY_LIST
-
Constructor Summary
ConstructorsConstructorDescriptionAlignmentPair
(Sequence query, Sequence subject, int queryStart, int queryEnd, int subjectStart, int subjectEnd, SubstitutionMatrix subMatrix) AlignmentPair
(Sequence query, Sequence subject, SubstitutionMatrix subMatrix) -
Method Summary
Modifier and TypeMethodDescriptionstatic AlignmentPair
align
(Sequence query, Sequence subject, AlignmentAlgorithm algorithm) formatOutput
(int width) This method provides a BLAST-like formated alignment from the givenString
s, in which the sequence coordinates and the information "Query" or "Sbjct", respectively is added to each line.long
int
int
int
int
float
float
float
float
float
float
getQuery()
Return the query sequence as a gapped sequence.int
int
int
Return the subject sequence as a gapped sequence.int
int
int
Methods inherited from class org.biojava.bio.alignment.SimpleAlignment
finalize, getAlphabet, getLabels, getScore, length, setScore, subAlignment, symbolAt, symbolAt, symbolListForLabel, symbolListIterator
Methods inherited from class org.biojava.bio.symbol.AbstractSymbolList
edit, equals, hashCode, iterator, seqString, subList, subStr, toList, toString
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
AlignmentPair
public AlignmentPair(Sequence query, Sequence subject, int queryStart, int queryEnd, int subjectStart, int subjectEnd, SubstitutionMatrix subMatrix) throws IllegalArgumentException, BioException - Parameters:
queryStart
- the start position in the query, where the alignment starts. For example zero for normal Needleman-Wunsch-Alignments.queryEnd
- the end position, that means the sequence coordinate, which is the last symbol of the query sequence. Counting starts at zero!subjectStart
- These are all the same for the target. Have a look at these above.subjectEnd
-subMatrix
- the subsitution Matrix used for calculating the alignmentqueryLength
- The length of the query sequence without gaps.- Throws:
IllegalArgumentException
BioException
-
AlignmentPair
public AlignmentPair(Sequence query, Sequence subject, SubstitutionMatrix subMatrix) throws IllegalArgumentException, BioException - Parameters:
query
-subject
-subMatrix
-- Throws:
IllegalArgumentException
BioException
-
-
Method Details
-
align
public static AlignmentPair align(Sequence query, Sequence subject, AlignmentAlgorithm algorithm) throws Exception - Parameters:
query
-subject
-algorithm
-- Returns:
- Throws:
Exception
-
getQueryStart
- Returns:
- the queryStart
-
getQueryEnd
- Returns:
- the queryEnd
-
getSubjectStart
- Returns:
- the subjectStart
-
getSubjectEnd
- Returns:
- the subjectEnd
-
getComputationTime
- Returns:
- the time
-
getNumGapsInQuery
- Returns:
- the ngapsq
-
getNumGapsInSubject
- Returns:
- the ngapst
-
getNumIdenticals
- Returns:
- the identicals
-
getNumSimilars
- Returns:
- the similars
-
getPercentIdentityQuery
- Returns:
-
getPercentIdentitySubject
- Returns:
-
getPercentSimilarityQuery
- Returns:
-
getPercentSimilaritySubject
- Returns:
-
getQueryLength
- Returns:
-
getSubjectLength
- Returns:
-
getSubstitutionMatrix
- Returns:
- the subMatrix
-
formatOutput
- Returns:
- Throws:
BioException
-
formatOutput
This method provides a BLAST-like formated alignment from the givenString
s, in which the sequence coordinates and the information "Query" or "Sbjct", respectively is added to each line. Each line containswidth
sequence characters including the gap symbols plus the meta information. There is one white line between two pairs of sequences.- Parameters:
width
- the number of symbols to be displayed per line.- Returns:
- formated String.
- Throws:
BioException
-
getPercentGapsTarget
- Returns:
-
getPercentGapsQuery
- Returns:
-
getQuery
Return the query sequence as a gapped sequence.- Returns:
- the query sequence as a gapped sequence
-
getSubject
Return the subject sequence as a gapped sequence.- Returns:
- the subject sequence as a gapped sequence
-