Blast Runs In Unix Shell But Not Perl
2
0
Entering edit mode
12.3 years ago
jrymer1 ▴ 30

I'm trying to run BLAST in Ubuntu 12.04, using a virtual box. It works fine in the command line, and produces the appropriate results using this blastn -query myfasta.fna -db nt -out output.out

When I try to run it in my Perl script I get the error "Command line argument error: Argument "query". File is not accessible." I stored all the fastas I want to run against the BLAST database in an array named @filestoblastagainst.

foreach my $i (@filestoblastagainst) {
        if ($i =~ m/(.*)\.sff\.fna$/) {
        my $fna = "/home/user/fastadir/".$i;
        my $out=  "/home/user/fastadir/".$1.".out";
        my $database = "/home/user/blast/nt";
        my $query = "blastn -query $fna -db $database -out $out";
        system($query);
        if ($?) {die "command: $query failed\n"};
        }
}

I have had errors before because I'm working in VirtualBox. Would that be the issue here?

blast perl • 3.9k views
ADD COMMENT
3
Entering edit mode
12.3 years ago
Michael 55k

Your query file is not found, possibly your files or path setup is messed up. Simply do a 'print $query' then you will possibly spot the problem. That has nothing to do with vbox, never had any problems with perl inside it.

ADD COMMENT
0
Entering edit mode
12.3 years ago
Gingi ▴ 330

The path for blastn might not be set within Perl. For security reasons, it's also usually a bad practice to make system calls to non-builtins without the path being defined (but not necessarily hardcoded). Try hardcoding the path to blastn to see if that at least executes.

ADD COMMENT
0
Entering edit mode

Tried it, same error.

ADD REPLY

Login before adding your answer.

Traffic: 2214 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