Package org.biojava.bio.alignment
Class SequenceAlignment
- java.lang.Object
-
- org.biojava.bio.alignment.SequenceAlignment
-
- Direct Known Subclasses:
NeedlemanWunsch
public abstract class SequenceAlignment extends java.lang.Object
This Interface provides methods for the alignment of bio-sequences.- Author:
- Andreas Dräger
, Mark Schreiber
-
-
Constructor Summary
Constructors Constructor Description SequenceAlignment()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List
alignAll(SequenceIterator source, SequenceDB subjectDB)
static java.lang.StringBuffer
formatOutput(java.lang.String queryName, java.lang.String targetName, java.lang.String[] align, java.lang.String path, int queryStart, int queryEnd, long queryLength, int targetStart, int targetEnd, long targetLength, int editdistance, long time)
This method provides a BLAST-like formated alignment from the givenString
s, in which the sequence coordinates and the information "Query" or "Target", respectively is added to each line.abstract Alignment
getAlignment(SymbolList query, SymbolList subject)
This method also performs a sequence alignment of the two given sequences but it returns an Alignment object instead of the score.abstract java.lang.String
getAlignmentString()
abstract int
pairwiseAlignment(SymbolList query, SymbolList subject)
Performs a pairwise sequence alignment of the two given sequences.
-
-
-
Method Detail
-
getAlignmentString
public abstract java.lang.String getAlignmentString() throws java.lang.Exception
- Returns:
- a string representation of the alignment
- Throws:
BioException
java.lang.Exception
-
alignAll
public abstract java.util.List alignAll(SequenceIterator source, SequenceDB subjectDB) throws java.lang.Exception
- Parameters:
source
- a SequenceIterator containing a set of sequences to be aligned withsubjectDB
- the SequenceDB containing another set of sequences.- Returns:
- a list containing the results of all single alignments performed by this method.
- Throws:
NoSuchElementException
java.lang.Exception
-
pairwiseAlignment
public abstract int pairwiseAlignment(SymbolList query, SymbolList subject) throws java.lang.Exception
Performs a pairwise sequence alignment of the two given sequences.- Parameters:
query
-subject
-- Returns:
- score of the alignment or the distance.
- Throws:
java.lang.Exception
-
getAlignment
public abstract Alignment getAlignment(SymbolList query, SymbolList subject) throws java.lang.Exception
This method also performs a sequence alignment of the two given sequences but it returns an Alignment object instead of the score.- Parameters:
query
-subject
-- Returns:
- Alignment
- Throws:
java.lang.Exception
-
formatOutput
public static java.lang.StringBuffer formatOutput(java.lang.String queryName, java.lang.String targetName, java.lang.String[] align, java.lang.String path, int queryStart, int queryEnd, long queryLength, int targetStart, int targetEnd, long targetLength, int editdistance, long time)
This method provides a BLAST-like formated alignment from the givenString
s, in which the sequence coordinates and the information "Query" or "Target", respectively is added to each line. Each line contains 60 sequence characters including the gap symbols plus the meta information. There is one white line between two pairs of sequences.- Parameters:
queryName
- name of the query sequencetargetName
- name of the target sequencealign
- aString
-array, where the index 0 is the query sequence and index 1 the target sequence (for instancenew String[] {myQuerySequence.seqString(), myTargetSequence.seqString()}
)path
- the "path", that means a String containing white spaces and pipe ("|") symbols, which makes matches visible. The two strings inalign
have to have the same length and also the same length than thispath
.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!queryLength
- The length of the query sequence without gaps.targetStart
- These are all the same for the target. Have a look at these above.targetEnd
-targetLength
-editdistance
-time
- The time in milliseconds, which was needed to generate the alignment.- Returns:
- formated String.
-
-