This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Parsing Blast output on linux/unix

Hello All,

I recently ran the following command on linux:

*blastall -p blastn -d new_NotPatoDB.fa -i smallQuery.fasta  -o textout.xml -m 7*

The results I received are in XML format , I'm trying to extract the sequences with minimum hits. I tried using the following script: ncbiblastparser.pl by running the following command: perl ncbiblastparser.pl output.xml 5 parseout.txt but I get the following error:

*Can't locate Bio/SearchIO.pm in @INC (you may need to install the Bio::SearchIO module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ncbiblastparser.pl line 6.
BEGIN failed--compilation aborted at ncbiblastparser.pl line 6.*

I have downloaded the Bio/SearchIO.pm package a few times.

can anyone identify the problem? or have any other ideas or ways parse the results.

blast parse output python linux

Did you try install bioperl to your system?? Bio::SearchIO is module of Bioperl.

is this a homework question?

NO this is for a research project.

I don't see a dpkg command. What is the OS you're working on? Can you give us the output of uname -a?

Linux Bioinformatics 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

If you don't have to stick to XML, you should try tabular output (outfmt 6).

Then you can start learning how to parse it from ncbi webinar.
Basic UNIX command lines will work far better on tabular output compared to XML.

sudo perl -MCPAN -e shell
install Bio::SearchIO

Or if you want to parse xml in Bash, check this insightful post

But really the best option is to use -outfmt 6 (tabular output) and use sort, awk, etc.

0 answers

No answers yet.

Log in to answer this question.