|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.bio.alignment.SequenceAlignment
org.biojava.bio.alignment.NeedlemanWunsch
org.biojava.bio.alignment.SmithWaterman
public class SmithWaterman
Smith and Waterman developed an efficient dynamic programing algorithm
to perform local sequence alignments, which returns the most conserved
region of two sequences (longes common substring with modifications).
This algorithm is performed by the method pairwiseAlignment
of this class. It uses affine gap penalties if and only if the expenses
of a delete or insert operation are unequal to the expenses of gap extension.
This uses significantly more memory (four times as much) and increases
the runtime if swaping is performed.
| Field Summary |
|---|
| Fields inherited from class org.biojava.bio.alignment.NeedlemanWunsch |
|---|
alignment, CostMatrix, pairalign, subMatrix |
| Constructor Summary | |
|---|---|
SmithWaterman(double match,
double replace,
double insert,
double delete,
double gapExtend,
SubstitutionMatrix matrix)
Constructs the new SmithWaterman alignment object. |
|
| Method Summary | |
|---|---|
double |
pairwiseAlignment(Sequence query,
Sequence subject)
Overrides the method inherited from the NeedlemanWunsch and performs only a local alignment. |
void |
setDelete(double del)
Overrides the method inherited from the NeedlemanWunsch and sets the penalty for a delete operation to the specified value. |
void |
setGapExt(double ge)
Overrides the method inherited from the NeedlemanWunsch and sets the penalty for an extension of any gap (insert or delete) to the specified value. |
void |
setInsert(double ins)
Overrides the method inherited from the NeedlemanWunsch and sets the penalty for an insert operation to the specified value. |
void |
setMatch(double ma)
Overrides the method inherited from the NeedlemanWunsch and sets the penalty for a match operation to the specified value. |
void |
setReplace(double rep)
Overrides the method inherited from the NeedlemanWunsch and sets the penalty for a replace operation to the specified value. |
| Methods inherited from class org.biojava.bio.alignment.NeedlemanWunsch |
|---|
alignAll, getAlignment, getAlignmentString, getDelete, getEditDistance, getGapExt, getInsert, getMatch, getReplace, min, printAlignment, printCostMatrix, setSubstitutionMatrix |
| Methods inherited from class org.biojava.bio.alignment.SequenceAlignment |
|---|
formatOutput |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SmithWaterman(double match,
double replace,
double insert,
double delete,
double gapExtend,
SubstitutionMatrix matrix)
SubstitutionMatrix equals the alpabet of
both the query and the target Sequence. The alignment parameters here
are expenses and not scores as they are in the NeedlemanWunsch object.
scores are just given by multipliing the expenses with (-1). For example
you could use parameters like "-2, 5, 3, 3, 0". If the expenses for gap extension
are equal to the cost of starting a gap (delete or insert), no affine gap penalties
are used, which saves memory.
match - expenses for a matchreplace - expenses for a replace operationinsert - expenses for a gap opening in the query sequencedelete - expenses for a gap opening in the target sequencegapExtend - expenses for the extension of a gap which was started earlier.matrix - the SubstitutionMatrix object to use.| Method Detail |
|---|
public void setInsert(double ins)
setInsert in class NeedlemanWunschins - costs for a single insert operationpublic void setDelete(double del)
setDelete in class NeedlemanWunschdel - costs for a single deletion operationpublic void setGapExt(double ge)
setGapExt in class NeedlemanWunschge - costs for any gap extensionpublic void setMatch(double ma)
setMatch in class NeedlemanWunschma - costs for a single match operationpublic void setReplace(double rep)
setReplace in class NeedlemanWunschrep - costs for a single replace operation
public double pairwiseAlignment(Sequence query,
Sequence subject)
throws BioRuntimeException
pairwiseAlignment in class NeedlemanWunschBioRuntimeExceptionSequenceAlignment.pairwiseAlignment(org.biojava.bio.seq.Sequence, org.biojava.bio.seq.Sequence)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||