Using Blast From Within Perl.
2
0
Entering edit mode
11.3 years ago
Caitlin ▴ 100

Hi all.

I recently installed the latest version of Blast (standalone) on a Win XP machine and altered the appropriate path settings, i.e., C:\blast\bin. Having searched the web for an example of using blast from within Perl, I found an example that uses blastall but this program is not listed in the aforementioned folder. Does anyone have experience in conducting a blast search with perl (not bioperl)? Is there an easy method to determine if I have installed blast correctly? I did construct an ncbi.ini folder in C:\windows and it looks like the following:

; Start the section for BLAST configuration
[BLAST]
; Specifies the path where BLAST databases are installed
BLASTDB=C:\\blast\\bin
; Specifies the data sources to use for automatic resolution
; for sequence identifiers
DATA_LOADERS=none
; Specifies the BLAST database to use resolve protein sequences
;BLASTDB_PROT_DATA_LOADER=nr
; Specifies the BLAST database to use resolve protein sequences
;BLASTDB_NUCL_DATA_LOADER=nt
; Windowmasker settings (experimental)
[WINDOW_MASKER]
WINDOW_MASKER_PATH=C:\\blast\\bin\\windowmasker
; end of file

Thanks for the help.

Caitlin

perl blast sequencing • 6.9k views
ADD COMMENT
1
Entering edit mode

Why not Bioperl? It really makes running BLAST and parsing the results much easier. There's little point in using Perl just to run something that can easily be launched from a command line.

ADD REPLY
0
Entering edit mode

Hi.

BioPerl is...

1.) still at version 1.6.9

2.) not available for ActivePerl versions above 5.10.x (which is ridiculous).

3.) Very difficult to build (I have been repeatedly unsuccessful) on a win32 machine despite having the latest version of Strawberry Perl.

ADD REPLY
0
Entering edit mode

So basically your issue is Windows :) Seriously: install an Ubuntu VM. Perl comes as standard. Then "sudo apt-get install bioperl-live". Done.

ADD REPLY
0
Entering edit mode

If you installed the latest version did you install Blast or Blast+? They renamed the latest versions to Blast+ when they updated them a couple years ago. Secondly, you could take a look at the code for the PISCES redundancy removal scripts. They call Blast from within them, although they are quite old by now.

ADD REPLY
1
Entering edit mode
11.3 years ago
compatcg ▴ 50

If you open a command prompt and type "blastn -version" it should tell you if blast(n) is installed and present in your path. Are you looking for something like the following (change the first line to equal the path to your perl interpreter, if necessary)?

#!C:\strawberry\perl\bin\perl.exe
use strict;
use warnings;

my $database = "nt";
my $queryFile = "seqs.fasta";
my $outputFile = "blastresults.xml";

system("blastn -db $database -query $queryFile -out $outputFile -outfmt 5");

You'd then have the output file blastresults.xml, which you'd have to either process manually or open it and parse with Perl (I find BioPerl makes that task much easier).

ADD COMMENT
1
Entering edit mode
11.3 years ago
vijay ★ 1.6k

Just say blastn -h from some random path on your command line. If you are able to get he help menu, then you are spot on. Else you have to check out the system variables that you have set. You can set the path for your database as well (something like c:\ncbi\blast\db), this will make things much easier. You can use the blastn option directly as mentioned in the earlier answer.

ADD COMMENT

Login before adding your answer.

Traffic: 1589 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6