Mercurial > repos > bioitcore > splicetrap
comparison bin/downloaddb.pl @ 1:adc0f7765d85 draft
planemo upload
| author | bioitcore |
|---|---|
| date | Thu, 07 Sep 2017 15:06:58 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:d4ca551ca300 | 1:adc0f7765d85 |
|---|---|
| 1 use strict; | |
| 2 use Cwd; | |
| 3 | |
| 4 my %flags=( | |
| 5 "hg18"=>0, | |
| 6 "mm9"=>0, | |
| 7 "rn4"=>0, | |
| 8 ); | |
| 9 my $PROG = $0; | |
| 10 my $PROG_ABS_PATH = Cwd::abs_path($PROG); | |
| 11 $PROG_ABS_PATH = `dirname $PROG_ABS_PATH`; | |
| 12 chomp($PROG_ABS_PATH); | |
| 13 print "\n\tPrepare to download databases from CSHL...\n"; | |
| 14 | |
| 15 print "\tWhich database(s) do you want to download?\n"; | |
| 16 print "\tChoose from\t "; | |
| 17 foreach my $key (keys %flags) | |
| 18 { | |
| 19 print $key,"/"; | |
| 20 } | |
| 21 print "ALL \n\n\tseparated by blank...don't enter anything if you don't want to download!\n\nPlease enter:[NONE]"; | |
| 22 | |
| 23 my @dbnames = split(/\s+/,<>); | |
| 24 for (my $i=0;$i<@dbnames;$i++) | |
| 25 { | |
| 26 if (uc($dbnames[$i]) eq "ALL" ) | |
| 27 { | |
| 28 foreach my $key (keys %flags) | |
| 29 { | |
| 30 $flags{$key}=1; | |
| 31 } | |
| 32 last; | |
| 33 } | |
| 34 | |
| 35 if( exists $flags{$dbnames[$i]}) | |
| 36 { | |
| 37 $flags{$dbnames[$i]} = 1; | |
| 38 } | |
| 39 #system ("wget http://rulai.cshl.edu/splicetrap/db/") | |
| 40 } | |
| 41 | |
| 42 foreach my $key (keys %flags) | |
| 43 { | |
| 44 if ($flags{$key} ==1) | |
| 45 { | |
| 46 system ("wget http://rulai.cshl.edu/splicetrap/db/".$key.".tar.gz"); | |
| 47 print "untar the database file for $key...please wait..."; | |
| 48 system ("tar -ixzf $key.tar.gz"); | |
| 49 system ("rm $key.tar.gz"); | |
| 50 mkdir "$key/parallel"; | |
| 51 print "creating files for parallel computing...\n"; | |
| 52 system("bash $PROG_ABS_PATH/splitdb.sh $key/parallel") | |
| 53 } | |
| 54 } |
