3 # multifetch.pl [options] <list of seqs>
5 # Fetch all the seqs on the list. The list is a file with one line
6 # per sequence; the first field is the key.
9 # -d : domain fetch - list is in GDF format
10 # -n <extra 5'> : include this many extra residues upstream (-d only)
11 # -c <extra 3'> : include this many extra residues downstream (-d only)
12 # -f : fetch in FASTA instead of native format
13 # -g <file> : use getseq from <file>, not fetch from main databases.
14 # This always gives FASTA output.
15 # -D <database> : specify a source database, same usage as getseq:
25 use lib $FindBin::Bin;
30 &Getopts('c:n:dfg:D:');
31 if ($opt_c) { $extra_c = $opt_c; }
32 if ($opt_n) { $extra_n = $opt_n; }
33 if ($opt_d) { $domains = 1; }
34 if ($opt_f) { $fmtarg = "-Ffasta";} else {$fmtarg = ""; }
35 if ($opt_g) { $filearg = "-d$opt_g ";} else {$filearg = ""; }
36 if ($opt_D) { $dbarg = "-D$opt_D "; } else {$dbarg = ""; }
41 if (($name, $from, $to, $source) = /^\s*(\S+)\s+(\d+)\s+(\d+)\s+(\S+)/){
51 system("$SFE $filearg $dbarg $fmtarg -r \"$name\" -f $from -t $to \"$source\"")
52 && die "\n\n$0: Unexpected error: Could not execute \"$SFE $filearg $dbarg $fmtarg -r \"$name\" -f $from -t $to \"$source\"\": $!";
58 system("$SFE $filearg $dbarg $fmtarg \"$key\"")
59 && die "\n\n$0: Unexpected error: Could not execute \"$SFE $filearg $dbarg $fmtarg \"$key\"\": $!";
66 # Added usage of rio_module.pm, $SFE for sfetch.
68 # Thu Apr 10 18:27:40 1997
70 # - simplified from six different getseq calls to two