Hi Colleagues,
I used the Blast parsing example from the Biojava tutorial and ran into this
problem:
######################
Failed to build SeqSimilaritySearchResult:
org.biojava.bio.BioException: Running BlastLikeSearchBuilder with null query
SequenceDB
at
org.biojava.bio.program.ssbind.BlastLikeSearchBuilder.makeSearchResult(BlastLikeSearchBuilder.java:239)
at
org.biojava.bio.program.ssbind.BlastLikeSearchBuilder.endSearch(BlastLikeSearchBuilder.java:319)
at
org.biojava.bio.program.ssbind.SeqSimilarityStAXAdapter.endElement(SeqSimilarityStAXAdapter.java:119)
at
org.biojava.utils.stax.SAX2StAXAdaptor.endElement(SAX2StAXAdaptor.java:153)
at
org.biojava.bio.program.ssbind.SeqSimilarityAdapter.endElement(SeqSimilarityAdapter.java:136)
at
org.biojava.bio.program.sax.AbstractNativeAppSAXParser.endElement(AbstractNativeAppSAXParser.java:300)
at org.biojava.bio.program.sax.BlastSAXParser.parse(BlastSAXParser.java:181)
at
org.biojava.bio.program.sax.BlastLikeSAXParser.onNewDataSet(BlastLikeSAXParser.java:311)
at
org.biojava.bio.program.sax.BlastLikeSAXParser.interpret(BlastLikeSAXParser.java:274)
at
org.biojava.bio.program.sax.BlastLikeSAXParser.parse(BlastLikeSAXParser.java:160)
###########################
I experimented with both supported Blast versions such as 2.2.3 and later
ones, such as 2.2.13, and with the lazymode both on and off, and concluded
that this problem is independent of Blast version and the lazymode. My
debugging didn't yield much fruit, except that the obvious cause of the
exception was BlastLikeSearchBuilder.querySeqHolder being null. Can someone
shed some light on this?
Here is the relevant section of my code:
try {
StringReader sr = new StringReader(in);
BlastLikeSAXParser parser = new BlastLikeSAXParser();
//works for 2.2.13?
//parser.setModeLazy();
//make the SAX event adapter that will pass events to a Handler.
SeqSimilarityAdapter adapter = new SeqSimilarityAdapter();
//set the parsers SAX event adapter
parser.setContentHandler(adapter);
//The list to hold the SeqSimilaritySearchResults
//List results = new ArrayList();
//create the SearchContentHandler that will build
SeqSimilaritySearchResults
//in the results List
SearchContentHandler builder = new
BlastLikeSearchBuilder(results);
//register builder with adapter
adapter.setSearchContentHandler(builder);
//parse the file, after this the result List will be populated
with SeqSimilaritySearchResults
parser.parse(new InputSource(sr));
//output some blast details - expect 1 result only
......
Thanks,
Jianjun
_______________________________________________
Biojava-l mailing list - [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l