Package org.biojava.bio.dp
Class WeightMatrixAnnotator
- java.lang.Object
-
- org.biojava.bio.dp.WeightMatrixAnnotator
-
- All Implemented Interfaces:
Serializable
,SequenceAnnotator
public class WeightMatrixAnnotator extends Object implements SequenceAnnotator, Serializable
Annotates a sequence with hits to a weight-matrix.This SequenceAnnotator implementation returns a new ViewSequence wrapping the underlying Sequence
- Author:
- Matthew Pocock, Thomas Down, Tanya Vavouri
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WeightMatrixAnnotator(WeightMatrix wm, double threshold)
Create a new annotator that uses PROBABILITY score type.WeightMatrixAnnotator(WeightMatrix wm, ScoreType scoreType, double threshold)
Create a new annotator that uses a specific score type.WeightMatrixAnnotator(WeightMatrix wm, ScoreType scoreType, double threshold, String wmID)
Create a new annotator that uses the PROBABILITY score type and an ID for the weight matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sequence
annotate(Sequence seq)
Return an annotated version of a sequence.String
getWeightMatrixID()
Get the value of the weight matrix id.void
setWeightMatrixID(String id)
Set the weight matrix id.
-
-
-
Constructor Detail
-
WeightMatrixAnnotator
public WeightMatrixAnnotator(WeightMatrix wm, ScoreType scoreType, double threshold, String wmID)
Create a new annotator that uses the PROBABILITY score type and an ID for the weight matrix.- Parameters:
wm
- the weight matrixthreshold
- the thresholdwmID
- the weight matrix ID
-
WeightMatrixAnnotator
public WeightMatrixAnnotator(WeightMatrix wm, double threshold)
Create a new annotator that uses PROBABILITY score type.- Parameters:
wm
- aWeightMatrix
valuethreshold
- adouble
value
-
WeightMatrixAnnotator
public WeightMatrixAnnotator(WeightMatrix wm, ScoreType scoreType, double threshold)
Create a new annotator that uses a specific score type.- Parameters:
wm
- the weigth matrixscoreType
- the score typethreshold
- the threshold- Since:
- 1.4
-
-
Method Detail
-
annotate
public Sequence annotate(Sequence seq) throws IllegalAlphabetException, BioException, ChangeVetoException
Description copied from interface:SequenceAnnotator
Return an annotated version of a sequence.- Specified by:
annotate
in interfaceSequenceAnnotator
- Parameters:
seq
- The sequence to be annotated.- Returns:
- An annotated version of
seq
(may be the same object). - Throws:
IllegalAlphabetException
- If the sequence is over an inappropriate alphabet for the annotated method being encapsulatedBioException
- if the sequence fails to be annotatedChangeVetoException
- if either the sequence doesn't allow annotation or if the change was vetoed
-
getWeightMatrixID
public String getWeightMatrixID()
Get the value of the weight matrix id.- Returns:
- value of the weight matrix id.
-
setWeightMatrixID
public void setWeightMatrixID(String id)
Set the weight matrix id.- Parameters:
id
- Value to assign to the weight matrix id.
-
-