Package org.biojava.bio.program.ssbind
Class BlastLikeSearchBuilder
java.lang.Object
org.biojava.bio.program.ssbind.BlastLikeSearchBuilder
- All Implemented Interfaces:
SearchBuilder,SearchContentHandler
BlastLikeSearchBuilder will create
SeqSimilaritySearchResults from SAX events via a
SeqSimilarityAdapter. The SAX events should describe
elements conforming to the BioJava BlastLikeDataSetCollection
DTD. Suitable sources are BlastLikeSAXParser or
FastaSearchSAXParser. The result objects are placed in
the List supplied to the constructor.
The start/end/strand of SeqSimilaritySearchHits are
calculated from their constituent
SeqSimilaritySearchSubHits as follows:
- The query start is the lowest query start coordinate of its sub-hits, regardless of strand
- The query end is the highest query end coordinate of its sub-hits, regardless of strand
- The hit start is the lowest hit start coordinate of its sub-hits, regardless of strand
- The hit end is the highest hit end coordinate of its sub-hits, regardless of strand
- The query strand is null for protein sequences. Otherwise it is
equal to the query strand of its sub-hits if they are all on the
same strand, or
StrandedFeature.UNKNOWNif the sub-hits have mixed query strands - The hit strand is null for protein sequences. Otherwise it is
equal to the hit strand of its sub-hits if they are all on the same
strand, or
StrandedFeature.UNKNOWNif the sub-hits have mixed hit strands
This class has special meanings for particular keys: if you want to adapt this class for another parser, you will need to be aware of this. These originate from and are fully described in the BlastLikeDataSetCollection DTD.
| Key | Meaning |
|---|---|
| program | either this value or the subjectSequenceType value must be set. This can take values acceptable to AlphabetResolver. These are BLASTN, BLASTP, BLASTX, TBLASTN, TBLASTX, DNA and PROTEIN. |
| databaseId | Identifier of database searched (in SequenceDBInstallation). |
| subjectSequenceType | type of sequence that hit is. Can be DNA or PROTEIN. |
| subjectId | id of sequence that is hit |
| subjectDescription | description of sequence that is hit |
| queryStrand | Strandedness of query in alignment. Takes values of "plus" and "minus" |
| subjectStrand | Strandedness of query in alignment. Takes values of "plus" and "minus" |
| queryFrame | self-evident |
| subjectFrame | self-evident |
| querySequenceStart | self-evident |
| querySequenceEnd | self-evident |
| subjectSequenceStart | self-evident |
| subjectSequenceEnd | self-evident |
| score | self-evident |
| expectValue | self-evident |
| pValue | self-evident |
- Since:
- 1.2
- Author:
- Keith James, Greg Cox
-
Constructor Summary
ConstructorsConstructorDescriptionBlastLikeSearchBuilder(List target) Creates a newBlastLikeSearchBuilderwhich will instantiate results into theListtarget.BlastLikeSearchBuilder(List target, SequenceDB querySeqHolder, SequenceDBInstallation subjectDBs) Creates a newBlastLikeSearchBuilderwhich will instantiate results into theListtarget. -
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.booleangetMoreSearchesreturns the state of theSearchContentHandlerwith respect to further searches from its data source.ThemakeSearchResultmethod returns aSeqSimilaritySearchResultinstance created from accumulated data.voidsetDatabaseID(String databaseID) setDatabaseIDidentifies the database searched by a name, ID or URN.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.voidsetQuerySeqHolder(SequenceDB querySeqHolder) setQuerySeqHoldersets the query sequence holder to a specific database.voidsetSubjectDBInstallation(SequenceDBInstallation subjectDBs) setSubjectDBInstallationsets the subject database holder to a specific installation.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.
-
Constructor Details
-
BlastLikeSearchBuilder
Creates a newBlastLikeSearchBuilderwhich will instantiate results into theListtarget.- Parameters:
target- aList.
-
BlastLikeSearchBuilder
public BlastLikeSearchBuilder(List target, SequenceDB querySeqHolder, SequenceDBInstallation subjectDBs) Creates a newBlastLikeSearchBuilderwhich will instantiate results into theListtarget.- Parameters:
target- aList.querySeqHolder- aSequenceDBof query sequences.subjectDBs- aSequenceDBInstallationof databases searched.
-
-
Method Details
-
makeSearchResult
Description copied from interface:SearchBuilderThemakeSearchResultmethod returns aSeqSimilaritySearchResultinstance created from accumulated data.- Specified by:
makeSearchResultin interfaceSearchBuilder- Returns:
- a
SeqSimilaritySearchResult. - Throws:
BioException- if an error occurs.
-
setQuerySeqHolder
setQuerySeqHoldersets the query sequence holder to a specific database.- Parameters:
querySeqHolder- aSequenceDBcontaining the query sequence(s).
-
setSubjectDBInstallation
setSubjectDBInstallationsets the subject database holder to a specific installation.- Parameters:
subjectDBs- aSequenceDBInstallationcontaining the subject database(s)
-
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.
-
setDatabaseID
Description copied from interface:SearchContentHandlersetDatabaseIDidentifies the database searched by a name, ID or URN.- Specified by:
setDatabaseIDin interfaceSearchContentHandler- Parameters:
databaseID- aStringwhich should be an unique identifier for the database searched.
-
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.
-