我试图让下面的perl脚本工作。首先,读取fastq文件,然后使用该文件通过多个程序进行分析。尝试使用PBS运行脚本时出现open3错误::客户端
代码:
use warnings;
use PBS::Client;
$directory = $ARGV[0];
opendir(DIR, $directory);
@files=();
while ($file = readdir(DIR)) {
push(@files, $file);
}
closedir(DIR);
@fastq_files = grep(/fastq/, @files);
$client = PBS::Client->new();
foreach $fastq (@fastq_files){
@commands =();
$wd = "/store/www/labresults_QC/snRNA_sequence_analyser/".$ARGV[0];
$name = $fastq."_process_map";
$queue = "system";
$wallt = "72:00:00";
chomp($fastq);
$fastq =~ /.+[^\.fastq]/;
push (@commands, "/opt/fastx_toolkit-0.0.13.2/bin/fastq_quality_filter -q 30 -p 80 -i " . $fastq . " -o ";
push (@commands, "/opt/fastx_toolkit-0.0.13.2/bin/fastx_clipper -i " . $& . "_qc.fastq -o " . $& . "_qc_clipped.fastq -v -l 15 -a TGGAATTCTCGGGTGCCAAGG -Q33\n");
push (@commands, "/opt/fastx_toolkit-0.0.13.2/bin/fastx_collapser -i " . $& . "_qc_clipped.fastq -o " . $& . "_qc_clipped_collapse.fa -v -Q33\n");
push (@commands, "/opt/bowtie-1.0.0/bowtie -f /opt/genomes/9606/GRCh37/bowtie/GRCh37 " . $& . "_qc_clipped_collapse.fa " . $& . "_mapped.sam -k 100 -n 0 -l 25 --best");
$job = PBS::Client::Job -> new(
wd => $wd,
queue => $queue,
name => $name,
wallt => $wallt,
cmd => [[@commands]]);
$client -> qsub($job);
}
然而,试图通过Linux命令行来执行时,它使此错误消息:
open3: exec of /store/www/labresults_QC/snRNA_sequence_analyser/data/data_raw/test_run/n8XyeYIkfv failed at /store/bin/perl_libs/lib/perl5//PBS/Client.pm line 150
该错误消息指向这一段代码在PBS客户端模块:
#-------------------------------------------------------------------
# Thanks to Sander Hulst
sub call_qsub
{
my @args = @_;
# If the qsub command fails, for instance, pbs_server is not running,
# PBS::Client's qsub should not silently ignore. Disable any reaper
# functions so the exit code can be captured
use Symbol qw(gensym);
use IPC::Open3;
my $stdout = gensym();
my $stderr = gensym();
{
local $SIG{CHLD} = sub{};
my $pid = open3(gensym, $stdout, $stderr, @args); # This is line 150
waitpid($pid,0);
}
confess <$stderr> if ($?);
return <$stdout>;
}
#-------------------------------------------------------------------
任何人都知道这意味着什么?
编辑
经过一番调查似乎这行失败:$client -> qsub($job);
,但我不知道为什么。任何想法我做错了什么?
最后编辑:
所以,我们终于发现了问题的真正原因。事实证明,我们所做的最新安装PBS::Client
出了问题。所以我们回到了一个较旧的版本,问题就此消失了!
添加'使用严格的;'到文件的顶部,并宣布(用'my')所有的变量,强烈推荐,因为它可以防止很多简单的错误。你看过** PBS Client **模块的第150行和它的文档吗?检查导致第150行的代码应该提供一些关于正在发生的事情以及为什么报告错误的线索。 – AdrianHHH
我已经做了'严格使用'和'我的',但是它发生了这个错误。错误点所在的行并没有让我明白... – Fingashpitzzz
我包含** PBS客户端的相关代码** – Fingashpitzzz