Class ProteinLocalAlignment
- java.lang.Object
-
- edu.rit.compbio.seq.ProteinLocalAlignment
-
- Direct Known Subclasses:
- ProteinLocalAlignmentSeq, ProteinLocalAlignmentSmp
public abstract class ProteinLocalAlignment extends java.lang.ObjectClass ProteinLocalAlignment is the abstract base class for an object that does local alignments of ProteinSequences. Class ProteinLocalAlignment uses the Smith-Waterman algorithm with a substitution matrix (such as BLOSUM-62) and affine gap penalties. To do a local alignment:- Create an instance of class ProteinLocalAlignment.
- If desired, call setSubstitutionMatrix() to set the substitution matrix. If not set, the default is the BLOSUM-62 substitution matrix.
- If desired, call setGapExistencePenalty() to set the gap existence penalty. If not set, the default is −11.
- If desired, call setGapExtensionPenalty() to set the gap extension penalty. If not set, the default is −1.
- Call setQuerySequence() to set the query sequence.
- Call setSubjectSequence() to set the subject sequence.
- Call align() to do the alignment between the query sequence and the subject sequence in a single thread. The align() method returns an Alignment object.
To do another local alignment with the same query sequence and a different subject sequence, repeat steps 6-7. To do another local alignment with a different query sequence, repeat steps 5-7.
Subclasses of class ProteinLocalAlignment implement the Smith-Waterman algorithm differently.
-
-
Constructor Summary
Constructors Constructor and Description ProteinLocalAlignment()Construct a new protein sequence local alignment object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract Alignmentalign()Align the query sequence and the subject sequence.voidsetGapExistencePenalty(int g)Set the gap existence penalty.voidsetGapExtensionPenalty(int h)Set the gap extension penalty.voidsetQuerySequence(ProteinSequence theSequence, long theId)Set the query sequence.voidsetSubjectSequence(ProteinSequence theSequence, long theId)Set the subject sequence.voidsetSubstitutionMatrix(int[][] matrix)Set the protein substitution matrix.
-
-
-
Constructor Detail
-
ProteinLocalAlignment
public ProteinLocalAlignment()
Construct a new protein sequence local alignment object.
-
-
Method Detail
-
setSubstitutionMatrix
public void setSubstitutionMatrix(int[][] matrix)
Set the protein substitution matrix. If not set, the default is the BLOSUM-62 substitution matrix.The matrix must be a 27×27-element matrix of integers. The expression matrix[x][y] is the score when amino acid x is aligned with amino acid y, where x and y are amino acids in the range 0..27 from a ProteinSequence.
- Parameters:
matrix- Protein substition matrix.
-
setGapExistencePenalty
public void setGapExistencePenalty(int g)
Set the gap existence penalty. If not set, the default is −11.The gap existence penalty is added to the alignment score for the first position of a gap.
- Parameters:
g- Gap existence penalty. Assumed to be a negative integer.
-
setGapExtensionPenalty
public void setGapExtensionPenalty(int h)
Set the gap extension penalty. If not set, the default is −1.The gap extension penalty is added to the alignment score for the second and subsequent positions of a gap.
- Parameters:
h- Gap extension penalty. Assumed to be a negative integer.
-
setQuerySequence
public void setQuerySequence(ProteinSequence theSequence, long theId)
Set the query sequence. The query sequence ID is an arbitrary integer; for example, it could be the index of a sequence in a ProteinDatabase.- Parameters:
theSequence- Query sequence.theId- Query sequence ID.
-
setSubjectSequence
public void setSubjectSequence(ProteinSequence theSequence, long theId)
Set the subject sequence. The subject sequence ID is an arbitrary integer; for example, it could be the index of a sequence in a ProteinDatabase.- Parameters:
theSequence- Subject sequence.theId- Subject sequence ID.
-
align
public abstract Alignment align() throws java.lang.Exception
Align the query sequence and the subject sequence.Calling the returned Alignment object's getQueryId() method will return the query sequence ID supplied to the setQuerySequence() method. Calling the returned Alignment object's getSubjectId() method will return the subject sequence ID supplied to the setSubjectSequence() method.
- Returns:
- Alignment.
- Throws:
java.lang.Exception- Thrown if an error occurred.
-
-
DMelt 3.0 © DataMelt by jWork.ORG