Tried it, same error.
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?
2 answers
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.
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.
Log in to answer this question.