|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aisb.bio.tools.SequenceAligner org.aisb.bio.tools.Needleman
This implements the Needleman/Wunsch algorithm, with gap penalties, including end gap penalties. This version gets the gap penalties correct. Another recent change is in the traceback matrix. Now, instead of each cell holding "0" or "1", it essentially holds the number of alignments known as of that location in the matrix. Known problems: I did not have time to implement the options I wanted to for printing out the sequences alignments. They're all calculated, in the "traceback" matrix. Generating one string from that matrix is easy (and done); generating the full set turned out to take more time than I had allotted for this task.
Constructor Summary | |
Needleman(MonomerComparator comparator,
int gapCreationPenalty,
int gapExtensionPenalty)
This constructor is a little cleaner to use outside of contexts in which the command bean is really useful. |
Method Summary | |
void |
execute()
Perform the operation. |
java.lang.String |
getAlignmentAsString(int n)
|
java.lang.String |
getBestAlignmentAsString()
Get the actual best alignment, in the form of a string consisting of tuples representing positions in the alignment. |
java.lang.Character[][] |
getBestAlignmentsAsMatrix()
Get the set of best alignments, in the form of a matrix. |
java.lang.String[] |
getBestAlignmentsAsStrings()
Get the set of best alignments, in the form of an array of strings consisting of tuples representing positions in the alignment. |
int |
getBestAlignmentScore()
Get the best alignment score, as defined by this algorithm. |
MonomerComparator |
getComparator()
Set the comparator to use to match each pair of elements. |
int |
getGapCreationPenalty()
|
int |
getGapExtensionPenalty()
|
int |
getNumberOfAlignments()
Get the number of alignments that have the best score. |
void |
setComparator(MonomerComparator comparator)
Returns the comparator currently in use. |
void |
setGapCreationPenalty(int gapCreationPenalty)
|
void |
setGapExtensionPenalty(int gapExtensionPenalty)
|
Methods inherited from class org.aisb.bio.tools.SequenceAligner |
getFirstSequence, getSecondSequence, setFirstSequence, setSecondSequence |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Needleman(MonomerComparator comparator, int gapCreationPenalty, int gapExtensionPenalty)
comparator
- The comparison function to use.gapCreationPenalty
- The penalty for creating a new gap.gapExtensionPenalty
- The penalty for extending an existing gap.Method Detail |
public void execute()
SequenceAligner
execute
in class SequenceAligner
public int getNumberOfAlignments()
SequenceAligner
getNumberOfAlignments
in class SequenceAligner
public MonomerComparator getComparator()
public void setComparator(MonomerComparator comparator)
comparator
- The comparator to set.public int getGapCreationPenalty()
public void setGapCreationPenalty(int gapCreationPenalty)
gapCreationPenalty
- The gapCreationPenalty to set.public int getGapExtensionPenalty()
public void setGapExtensionPenalty(int gapExtensionPenalty)
gapExtensionPenalty
- The gapExtensionPenalty to set.public int getBestAlignmentScore()
SequenceAligner
getBestAlignmentScore
in class SequenceAligner
public java.lang.String getBestAlignmentAsString()
SequenceAligner
getBestAlignmentAsString
in class SequenceAligner
public java.lang.String getAlignmentAsString(int n)
public java.lang.String[] getBestAlignmentsAsStrings()
SequenceAligner
getBestAlignmentsAsStrings
in class SequenceAligner
public java.lang.Character[][] getBestAlignmentsAsMatrix()
SequenceAligner
getBestAlignmentsAsMatrix
in class SequenceAligner
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |