Package org.biojava.bio.search
Class SimpleSeqSimilaritySearchSubHit
- java.lang.Object
 - 
- org.biojava.utils.AbstractChangeable
 - 
- org.biojava.bio.search.SimpleSeqSimilaritySearchSubHit
 
 
 
- 
- All Implemented Interfaces:
 Annotatable,SeqSimilaritySearchSubHit,Changeable
public class SimpleSeqSimilaritySearchSubHit extends AbstractChangeable implements SeqSimilaritySearchSubHit
SimpleSeqSimilaritySearchSubHitobjects represent sub-hits which make up a hit. In the case of Blast these correspond to HSPs.- Since:
 - 1.1
 - Author:
 - Keith James, Gerald Loeffler
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder 
- 
Nested classes/interfaces inherited from interface org.biojava.bio.search.SeqSimilaritySearchSubHit
SeqSimilaritySearchSubHit.ByScoreComparator, SeqSimilaritySearchSubHit.BySubjectStartComparator 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected ChangeForwarderannotationForwarder- 
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION 
- 
Fields inherited from interface org.biojava.bio.search.SeqSimilaritySearchSubHit
byScore, bySubjectStart, QUERY_LABEL 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SimpleSeqSimilaritySearchSubHit(double score, double eValue, double pValue, int queryStart, int queryEnd, StrandedFeature.Strand queryStrand, int subjectStart, int subjectEnd, StrandedFeature.Strand subjectStrand, Alignment alignment, Annotation annotation)Creates a newSimpleSeqSimilaritySearchSubHitobject. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)AlignmentgetAlignment()Return an alignment of (possibly part of) the query sequence against (possibly part of) this hit sequence.AnnotationgetAnnotation()getAnnotationreturns the Annotation associated with this sub-hit.protected ChangeSupportgetChangeSupport(ChangeType ct)Called to retrieve the ChangeSupport for this object.doublegetEValue()Return the E-value of this sub-hit.doublegetPValue()Return the P-value of this sub-hit.intgetQueryEnd()Return the end position of the sub-hit in the query sequence.intgetQueryStart()Return the start position of the sub-hit in the query sequence.StrandedFeature.StrandgetQueryStrand()Return the strand of the sub-hit with respect to the query sequence.doublegetScore()Return the score of this sub-hit in the units defined by the search algorithm.intgetSubjectEnd()Return the start position of the sub-hit in the subject sequence.intgetSubjectStart()Return the start position of the sub-hit in the subject sequence.StrandedFeature.StrandgetSubjectStrand()Return the strand of the sub-hit with respect to the subject sequence.inthashCode()StringtoString()- 
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener 
- 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener 
 - 
 
 - 
 
- 
- 
Field Detail
- 
annotationForwarder
protected transient ChangeForwarder annotationForwarder
 
 - 
 
- 
Constructor Detail
- 
SimpleSeqSimilaritySearchSubHit
public SimpleSeqSimilaritySearchSubHit(double score, double eValue, double pValue, int queryStart, int queryEnd, StrandedFeature.Strand queryStrand, int subjectStart, int subjectEnd, StrandedFeature.Strand subjectStrand, Alignment alignment, Annotation annotation)
Creates a newSimpleSeqSimilaritySearchSubHitobject.- Parameters:
 queryStart- anintvalue indicating the start coordinate of the hit on the query sequence.queryEnd- anintvalue indicating the end coordinate of the hit on the query sequence.queryStrand- aStrandobject indicating the strand of the hit with respect to the query sequence, which may be null for protein similarities.subjectStart- anintvalue indicating the start coordinate of the hit on the subject sequence.subjectEnd- anintvalue indicating the end coordinate of the hit on the query sequence.subjectStrand- aStrandobject indicating the strand of the hit with respect to the query sequence, which may be null for protein similarities.score- adoublevalue; the score of the subhit, which may not be NaN.eValue- adoublethe E-value of the subhit, which may be NaN.pValue- adoublevalue; the P-value of the hit, which may be NaN.alignment- anAlignmentobject containing the alignment described by the subhit region, which may not be null.
 
 - 
 
- 
Method Detail
- 
getScore
public double getScore()
Description copied from interface:SeqSimilaritySearchSubHitReturn the score of this sub-hit in the units defined by the search algorithm.- Specified by:
 getScorein interfaceSeqSimilaritySearchSubHit- Returns:
 - the score of this sub-hit. This is a mandatory piece of information and hence may not be NaN.
 
 
- 
getPValue
public double getPValue()
Description copied from interface:SeqSimilaritySearchSubHitReturn the P-value of this sub-hit.- Specified by:
 getPValuein interfaceSeqSimilaritySearchSubHit- Returns:
 - the P-value of this sub-hit. This is an optional (but desired) piece of information and implementations of this interface may return NaN if a P-value is not available for this hit.
 
 
- 
getEValue
public double getEValue()
Description copied from interface:SeqSimilaritySearchSubHitReturn the E-value of this sub-hit.- Specified by:
 getEValuein interfaceSeqSimilaritySearchSubHit- Returns:
 - the E-value of this sub-hit. This is an optional (but desired) piece of information and implementations of this interface may return NaN if an E-value is not available for this hit.
 
 
- 
getQueryStart
public int getQueryStart()
Description copied from interface:SeqSimilaritySearchSubHitReturn the start position of the sub-hit in the query sequence.- Specified by:
 getQueryStartin interfaceSeqSimilaritySearchSubHit- Returns:
 - an 
int. 
 
- 
getQueryEnd
public int getQueryEnd()
Description copied from interface:SeqSimilaritySearchSubHitReturn the end position of the sub-hit in the query sequence.- Specified by:
 getQueryEndin interfaceSeqSimilaritySearchSubHit- Returns:
 - an 
int. 
 
- 
getQueryStrand
public StrandedFeature.Strand getQueryStrand()
Description copied from interface:SeqSimilaritySearchSubHitReturn the strand of the sub-hit with respect to the query sequence. This may be null for protein sequences.- Specified by:
 getQueryStrandin interfaceSeqSimilaritySearchSubHit- Returns:
 - a 
Strand. 
 
- 
getSubjectStart
public int getSubjectStart()
Description copied from interface:SeqSimilaritySearchSubHitReturn the start position of the sub-hit in the subject sequence.- Specified by:
 getSubjectStartin interfaceSeqSimilaritySearchSubHit- Returns:
 - an 
int. 
 
- 
getSubjectEnd
public int getSubjectEnd()
Description copied from interface:SeqSimilaritySearchSubHitReturn the start position of the sub-hit in the subject sequence.- Specified by:
 getSubjectEndin interfaceSeqSimilaritySearchSubHit- Returns:
 - an 
int. 
 
- 
getSubjectStrand
public StrandedFeature.Strand getSubjectStrand()
Description copied from interface:SeqSimilaritySearchSubHitReturn the strand of the sub-hit with respect to the subject sequence. This may be null for protein sequences.- Specified by:
 getSubjectStrandin interfaceSeqSimilaritySearchSubHit- Returns:
 - a 
Strand. 
 
- 
getAlignment
public Alignment getAlignment()
Description copied from interface:SeqSimilaritySearchSubHitReturn an alignment of (possibly part of) the query sequence against (possibly part of) this hit sequence. In this alignment, the query is identified by the label given by the static field QUERY_LABEL.- Specified by:
 getAlignmentin interfaceSeqSimilaritySearchSubHit- Returns:
 - the alignment of the query sequence against this hit sequence.
 
 
- 
getAnnotation
public Annotation getAnnotation()
getAnnotationreturns the Annotation associated with this sub-hit.- Specified by:
 getAnnotationin interfaceAnnotatable- Returns:
 - an 
Annotation. 
 
- 
getChangeSupport
protected ChangeSupport getChangeSupport(ChangeType ct)
Description copied from class:AbstractChangeableCalled to retrieve the ChangeSupport for this object.Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;- Overrides:
 getChangeSupportin classAbstractChangeable
 
 - 
 
 -