Class SimilarityPairBuilder
- All Implemented Interfaces:
SearchContentHandler
SimilarityPairBuilder annotates query and subject
Sequence with SimilarityPairFeatures
created from SAX events supplied via a
SeqSimilarityAdapter. The objective is to describe a
simple pairwise relationship between the two sequences. This
differs slightly from using HomologyFeatures which are
slightly heavier, have to contain a full alignment and don't have
an explicit distinction between query and subject sequences in the
alignment. The SAX events should describe elements conforming to
the BioJava BlastLikeDataSetCollection DTD. Suitable sources are
BlastLikeSAXParser or FastaSAXParser.
Annotated ViewSequences wrapping both query and
subject sequences are created.
The current implementation should be used with care on streams containing more than one search output. This is because the builder will not stop after each report has been processed and as a result all the subject sequences get instantiated and a large object network could be created during processing.
- Since:
- 1.2
- Author:
- Keith James, Greg Cox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantSIMILARITY_PAIR_FEATURE_TYPEthe type String used bySimilarityPairBuilderwhen creatingSimilarityPairFeatures.Fields inherited from class org.biojava.bio.program.ssbind.ViewSequenceFactory
databaseID, querySeqHolder, queryViewCache, subjectDBs, subjectViewCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHitProperty(Object key, Object value) TheaddHitPropertymethod adds a key/value pair containing some property of a particular hit.voidaddSearchProperty(Object key, Object value) TheaddSearchPropertymethod adds a key/value pair containing some property of the overall search result.voidaddSubHitProperty(Object key, Object value) TheaddSubHitPropertymethod adds a key/value pair containing some property of a particular subhit.voidTheendHeadermethod indicates the end of a formatted header.voidendHit()TheendHitmethod indicates the end of a formatted hit.voidTheendSearchmethod indicates the end of useful search information.voidTheendSubHitmethod indicates the end of a formatted subhit.getAnnotatedQuerySeq(String queryID) getAnnotatedSubjectSeq(String subjectID) booleangetMoreSearchesreturns the state of theSearchContentHandlerwith respect to further searches from its data source.voidsetMoreSearches(boolean value) setMoreSearchessets the state of theSearchContentHandler's expectation of receiving more results.voidsetQueryID(String queryID) setQueryIDidentifies the query sequence by a name, ID or URN.voidThestartHeadermethod indicates the start of a formatted header.voidstartHit()ThestartHitmethod indicates the start of a formatted hit.voidThestartSearchmethod indicates the start of useful search information.voidThestartSubHitmethod indicates the start of a formatted subhit.Methods inherited from class org.biojava.bio.program.ssbind.ViewSequenceFactory
getQuerySeqHolder, getSubjectDBInstallation, makeQueryViewSequence, makeSubjectViewSequence, setDatabaseID, setQuerySeqHolder, setSubjectDBInstallationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.bio.search.SearchContentHandler
setDatabaseID
-
Field Details
-
SIMILARITY_PAIR_FEATURE_TYPE
ConstantSIMILARITY_PAIR_FEATURE_TYPEthe type String used bySimilarityPairBuilderwhen creatingSimilarityPairFeatures. This is the String which is returned when aSimilarityPairFeature'sgetType()method is called.- See Also:
-
-
Constructor Details
-
SimilarityPairBuilder
public SimilarityPairBuilder()
-
-
Method Details
-
getAnnotatedQuerySeq
- Throws:
IllegalIDException
-
getAnnotatedSubjectSeq
- Throws:
IllegalIDException
-
setQueryID
Description copied from interface:SearchContentHandlersetQueryIDidentifies the query sequence by a name, ID or URN.- Specified by:
setQueryIDin interfaceSearchContentHandler- Parameters:
queryID- aStringwhich should be an unique identifer for the sequence.
-
getMoreSearches
Description copied from interface:SearchContentHandlergetMoreSearchesreturns the state of theSearchContentHandlerwith respect to further searches from its data source. Used for handling streams of search results.- Specified by:
getMoreSearchesin interfaceSearchContentHandler- Returns:
- a
booleanvalue.
-
setMoreSearches
Description copied from interface:SearchContentHandlersetMoreSearchessets the state of theSearchContentHandler's expectation of receiving more results. Used for handling streams of search results.- Specified by:
setMoreSearchesin interfaceSearchContentHandler- Parameters:
value- abooleanvalue.
-
startSearch
Description copied from interface:SearchContentHandlerThestartSearchmethod indicates the start of useful search information.- Specified by:
startSearchin interfaceSearchContentHandler
-
endSearch
Description copied from interface:SearchContentHandlerTheendSearchmethod indicates the end of useful search information.- Specified by:
endSearchin interfaceSearchContentHandler
-
startHeader
Description copied from interface:SearchContentHandlerThestartHeadermethod indicates the start of a formatted header. This usually contains information relevant to the search as a whole.- Specified by:
startHeaderin interfaceSearchContentHandler
-
endHeader
Description copied from interface:SearchContentHandlerTheendHeadermethod indicates the end of a formatted header.- Specified by:
endHeaderin interfaceSearchContentHandler
-
startHit
Description copied from interface:SearchContentHandlerThestartHitmethod indicates the start of a formatted hit. This could be a single line, or a block of lines.- Specified by:
startHitin interfaceSearchContentHandler
-
endHit
Description copied from interface:SearchContentHandlerTheendHitmethod indicates the end of a formatted hit.- Specified by:
endHitin interfaceSearchContentHandler
-
startSubHit
Description copied from interface:SearchContentHandlerThestartSubHitmethod indicates the start of a formatted subhit. There may be zero or more of these per hit.- Specified by:
startSubHitin interfaceSearchContentHandler
-
endSubHit
Description copied from interface:SearchContentHandlerTheendSubHitmethod indicates the end of a formatted subhit.- Specified by:
endSubHitin interfaceSearchContentHandler
-
addSearchProperty
Description copied from interface:SearchContentHandlerTheaddSearchPropertymethod adds a key/value pair containing some property of the overall search result.- Specified by:
addSearchPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-
addHitProperty
Description copied from interface:SearchContentHandlerTheaddHitPropertymethod adds a key/value pair containing some property of a particular hit.- Specified by:
addHitPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-
addSubHitProperty
Description copied from interface:SearchContentHandlerTheaddSubHitPropertymethod adds a key/value pair containing some property of a particular subhit.- Specified by:
addSubHitPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-