【发布时间】:2015-11-12 19:52:56
【问题描述】:
这是 cwd 中的内容:
blastn_build.sh qscript
它们当前都设置为可执行(但不是二进制)
这是blastn_build.sh的内容:
#!/bin/bash
update_blastdb.pl --showall
下面是qscript的内容:
qsub -S /bin/bash -V -b n -N nt_wgs_build -pe smp 8 -j y -o ./nt_wgs_build.sge -l h=n10 -cwd -sync y "./blastn_build.sh"
update_blastdb.pl 在我的 PATH 中并以 #!/usr/bin/perl 开头
现在的问题:
运行 ./blastn_build.sh 按预期工作。 运行 ./qscript 不会...这是错误消息:
无法连接到 ftp.ncbi.nlm.nih.gov:参数无效
如果我从 ./blastn_build.sh 中删除 --showall 参数,那么 ./blastn_build.sh 和 ./qscript 都会按预期工作。问题似乎在于如何通过 qsub 正确地将 --showall 选项传递给 update_blastdb.pl。
任何帮助理解和修复将不胜感激!
update_blastdb.pl (blast-2.2.31 http://www.ncbi.nlm.nih.gov/books/NBK52640/) wgetftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ncbi-blast-2.2.31+-x64-linux.tar.gz
#!/usr/bin/perl
# $Id: update_blastdb.pl 446090 2014-09-11 12:12:27Z ivanov $
===========================================================================
#
# Author: Christiam Camacho
#
# File Description:
# Script to download the pre-formatted BLAST databases from the NCBI ftp
# server.
#
#
use strict;
use warnings;
use Net::FTP;
use Getopt::Long;
use Pod::Usage;
use File::stat;
use Digest::MD5;
use Archive::Tar;
use List::MoreUtils qw(uniq);
use constant NCBI_FTP => "ftp.ncbi.nlm.nih.gov";
use constant BLAST_DB_DIR => "/blast/db";
use constant USER => "anonymous";
use constant PASSWORD => "anonymous";
use constant DEBUG => 0;
use constant MAX_DOWNLOAD_ATTEMPTS => 3;
use constant EXIT_FAILURE => 2;
# Process command line options
my $opt_verbose = 1;
my $opt_quiet = 0;
my $opt_force_download = 0;
my $opt_help = 0;
my $opt_passive = 0;
my $opt_timeout = 120;
my $opt_showall = 0;
my $opt_show_version = 0;
my $opt_decompress = 0;
my $result = GetOptions("verbose+" => \$opt_verbose,
"quiet" => \$opt_quiet,
"force" => \$opt_force_download,
"passive" => \$opt_passive,
"timeout=i" => \$opt_timeout,
"showall" => \$opt_showall,
"version" => \$opt_show_version,
"decompress" => \$opt_decompress,
"help" => \$opt_help);
$opt_verbose = 0 if $opt_quiet;
die "Failed to parse command line options\n" unless $result;
pod2usage({-exitval => 0, -verbose => 2}) if $opt_help;
pod2usage({-exitval => 0, -verbose => 2}) unless (scalar @ARGV or
$opt_showall or
$opt_show_version);
#rest of code continues...
perl v 5.10.1
【问题讨论】:
-
如果不知道
update_blastdb.pl做了什么,就无法回答。闻起来像版本问题 - 你确定./blastn_build.sh正确传递给 qsub 吗?这是一个相对路径,所以你可能有路径遍历。 -
@Sobrique -- 我刚刚尝试更改 qscript 以引用完整路径:“/home/10019438/blastdb/2015_11_11/blastn_build.sh”但错误仍然存在。
-
如果从命令行运行
./update_blastdb.pl < /dev/null会发生什么?你得到错误了吗? -
@Jonathan Leffler -- 这给出了这个错误:stty: standard input: Inappropriate ioctl for device
-
那么看来,
update_blastdb.pl确实不是为了在终端上运行而设计的——原因我不知道。根据调用方式的不同,它会做不同的事情。qsub系统可能在没有终端连接的情况下运行它,这就是为什么< /dev/null测试很有趣。 '我很好奇是stty报告了错误——我想知道它是怎么回事,但我没有足够的好奇心下载找出答案。不清楚为什么 Perl 在从qsub运行而不是从终端运行时无法连接;网络不应该受到影响。