public class BlastLikeSearchBuilder extends Object implements SearchBuilder
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:
StrandedFeature.UNKNOWN if the sub-hits
have mixed query strandsStrandedFeature.UNKNOWN if the sub-hits have
mixed hit strandsThis 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 |
| Constructor and Description |
|---|
BlastLikeSearchBuilder(List target)
Creates a new
BlastLikeSearchBuilder which will
instantiate results into the List target. |
BlastLikeSearchBuilder(List target,
SequenceDB querySeqHolder,
SequenceDBInstallation subjectDBs)
Creates a new
BlastLikeSearchBuilder which will
instantiate results into the List target. |
| Modifier and Type | Method and Description |
|---|---|
void |
addHitProperty(Object key,
Object value)
The
addHitProperty method adds a key/value pair
containing some property of a particular hit. |
void |
addSearchProperty(Object key,
Object value)
The
addSearchProperty method adds a key/value pair
containing some property of the overall search result. |
void |
addSubHitProperty(Object key,
Object value)
The
addSubHitProperty method adds a key/value pair
containing some property of a particular subhit. |
void |
endHeader()
The
endHeader method indicates the end of a
formatted header. |
void |
endHit()
The
endHit method indicates the end of a formatted
hit. |
void |
endSearch()
The
endSearch method indicates the end of useful
search information. |
void |
endSubHit()
The
endSubHit method indicates the end of a
formatted subhit. |
boolean |
getMoreSearches()
getMoreSearches returns the state of the
SearchContentHandler with respect to further
searches from its data source. |
SeqSimilaritySearchResult |
makeSearchResult()
The
makeSearchResult method returns a
SeqSimilaritySearchResult instance created from
accumulated data. |
void |
setDatabaseID(String databaseID)
setDatabaseID identifies the database searched by
a name, ID or URN. |
void |
setMoreSearches(boolean value)
setMoreSearches sets the state of the
SearchContentHandler's expectation of receiving
more results. |
void |
setQueryID(String queryID)
setQueryID identifies the query sequence by a
name, ID or URN. |
void |
setQuerySeqHolder(SequenceDB querySeqHolder)
setQuerySeqHolder sets the query sequence holder
to a specific database. |
void |
setSubjectDBInstallation(SequenceDBInstallation subjectDBs)
setSubjectDBInstallation sets the subject database
holder to a specific installation. |
void |
startHeader()
The
startHeader method indicates the start of a
formatted header. |
void |
startHit()
The
startHit method indicates the start of a
formatted hit. |
void |
startSearch()
The
startSearch method indicates the start of
useful search information. |
void |
startSubHit()
The
startSubHit method indicates the start of a
formatted subhit. |
public BlastLikeSearchBuilder(List target)
BlastLikeSearchBuilder which will
instantiate results into the List target.target - a List.public BlastLikeSearchBuilder(List target, SequenceDB querySeqHolder, SequenceDBInstallation subjectDBs)
BlastLikeSearchBuilder which will
instantiate results into the List target.target - a List.querySeqHolder - a SequenceDB of query
sequences.subjectDBs - a SequenceDBInstallation of
databases searched.public SeqSimilaritySearchResult makeSearchResult() throws BioException
SearchBuildermakeSearchResult method returns a
SeqSimilaritySearchResult instance created from
accumulated data.makeSearchResult in interface SearchBuilderSeqSimilaritySearchResult.BioException - if an error occurs.public void setQuerySeqHolder(SequenceDB querySeqHolder)
setQuerySeqHolder sets the query sequence holder
to a specific database.querySeqHolder - a SequenceDB containing the
query sequence(s).public void setSubjectDBInstallation(SequenceDBInstallation subjectDBs)
setSubjectDBInstallation sets the subject database
holder to a specific installation.subjectDBs - a SequenceDBInstallation
containing the subject database(s)public void setQueryID(String queryID)
SearchContentHandlersetQueryID identifies the query sequence by a
name, ID or URN.setQueryID in interface SearchContentHandlerqueryID - a String which should be an unique
identifer for the sequence.public void setDatabaseID(String databaseID)
SearchContentHandlersetDatabaseID identifies the database searched by
a name, ID or URN.setDatabaseID in interface SearchContentHandlerdatabaseID - a String which should be an unique
identifier for the database searched.public boolean getMoreSearches()
SearchContentHandlergetMoreSearches returns the state of the
SearchContentHandler with respect to further
searches from its data source. Used for handling streams of
search results.getMoreSearches in interface SearchContentHandlerboolean value.public void setMoreSearches(boolean value)
SearchContentHandlersetMoreSearches sets the state of the
SearchContentHandler's expectation of receiving
more results. Used for handling streams of search results.setMoreSearches in interface SearchContentHandlervalue - a boolean value.public void startSearch()
SearchContentHandlerstartSearch method indicates the start of
useful search information.startSearch in interface SearchContentHandlerpublic void endSearch()
SearchContentHandlerendSearch method indicates the end of useful
search information.endSearch in interface SearchContentHandlerpublic void startHeader()
SearchContentHandlerstartHeader method indicates the start of a
formatted header. This usually contains information relevant to
the search as a whole.startHeader in interface SearchContentHandlerpublic void endHeader()
SearchContentHandlerendHeader method indicates the end of a
formatted header.endHeader in interface SearchContentHandlerpublic void startHit()
SearchContentHandlerstartHit method indicates the start of a
formatted hit. This could be a single line, or a block of
lines.startHit in interface SearchContentHandlerpublic void endHit()
SearchContentHandlerendHit method indicates the end of a formatted
hit.endHit in interface SearchContentHandlerpublic void startSubHit()
SearchContentHandlerstartSubHit method indicates the start of a
formatted subhit. There may be zero or more of these per hit.startSubHit in interface SearchContentHandlerpublic void endSubHit()
SearchContentHandlerendSubHit method indicates the end of a
formatted subhit.endSubHit in interface SearchContentHandlerpublic void addSearchProperty(Object key, Object value)
SearchContentHandleraddSearchProperty method adds a key/value pair
containing some property of the overall search result.addSearchProperty in interface SearchContentHandlerkey - an Object.value - an Object.public void addHitProperty(Object key, Object value)
SearchContentHandleraddHitProperty method adds a key/value pair
containing some property of a particular hit.addHitProperty in interface SearchContentHandlerkey - an Object.value - an Object.public void addSubHitProperty(Object key, Object value)
SearchContentHandleraddSubHitProperty method adds a key/value pair
containing some property of a particular subhit.addSubHitProperty in interface SearchContentHandlerkey - an Object.value - an Object.Copyright © 2014 BioJava. All rights reserved.