Question: Blast Runs In Unix Shell But Not Perl
0
gravatar for jrymer1
7.0 years ago by
jrymer130
jrymer130 wrote:

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?

perl blast • 2.6k views
ADD COMMENTlink written 7.0 years ago by jrymer130
3
gravatar for Michael Dondrup
7.0 years ago by
Bergen, Norway
Michael Dondrup46k wrote:

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 COMMENTlink written 7.0 years ago by Michael Dondrup46k
0
gravatar for Gingi
7.0 years ago by
Gingi330
Irvington, NY
Gingi330 wrote:

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 COMMENTlink written 7.0 years ago by Gingi330

Tried it, same error.

ADD REPLYlink written 7.0 years ago by jrymer130
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1709 users visited in the last hour