[Biojava-l] Blast xml parsing

Jose Duarte duarte at molgen.mpg.de
Mon Jun 19 12:35:14 UTC 2006


Jose Duarte wrote:

>mark.schreiber at novartis.com wrote:
>
>  
>
>>Hi -=
>>
>>I'm not sure where the percent identity gets sent but you can find out by 
>>using the example code 
>>(http://biojava.org/wiki/BioJava:CookBook:Blast:Echo).
>>
>>It is also a nice code base for making a custom blast parser that is not 
>>so object heavy. 
>>    
>>
>Thanks, that sounds good. However I have tried to run the BlastEcho.java 
>code and got following error:
>
>Exception in thread "main" org.xml.sax.SAXException: Could not recognise 
>the format of this file as one supported by the framework.
>    at 
>org.biojava.bio.program.sax.BlastLikeSAXParser.parse(BlastLikeSAXParser.java:182)
>    at BlastEcho.echo(BlastEcho.java:29)
>    at BlastEcho.main(BlastEcho.java:75)
>
>I am pretty sure that my xml file is well formated blast output. 
>Actually I've been parsing it already with code using biojava's 
>BlastXMLParser without problems. My blast version is blastp 2.2.10.
>
>Also this is happening despite BlastEcho calling the setModeLazy() 
>method of the parser object. As I understand it shouldn't be checking 
>for versions using this mode.
>  
>

I think I can answer my question now. I just found out that for some 
reason replacing line 17 in BlastEcho.java:

    BlastLikeSAXParser parser = new BlastLikeSAXParser();

for:

    BlastXMLParserFacade parser = new BlastXMLParserFacade();

it all works fine.

I have no idea what's the difference between the BlastLikeSAXParser and 
the BlastXMLParserFacade classes but it looks as it works as good. I can 
change the code in the wiki if somebody can confirm this is correct.

Cheers

Jose




More information about the Biojava-l mailing list