Mercurial > repos > bioitcore > splicetrap
diff bin/downloaddb.pl @ 1:adc0f7765d85 draft
planemo upload
author | bioitcore |
---|---|
date | Thu, 07 Sep 2017 15:06:58 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/downloaddb.pl Thu Sep 07 15:06:58 2017 -0400 @@ -0,0 +1,54 @@ +use strict; +use Cwd; + +my %flags=( + "hg18"=>0, + "mm9"=>0, + "rn4"=>0, +); +my $PROG = $0; +my $PROG_ABS_PATH = Cwd::abs_path($PROG); +$PROG_ABS_PATH = `dirname $PROG_ABS_PATH`; +chomp($PROG_ABS_PATH); +print "\n\tPrepare to download databases from CSHL...\n"; + +print "\tWhich database(s) do you want to download?\n"; +print "\tChoose from\t "; +foreach my $key (keys %flags) +{ + print $key,"/"; +} +print "ALL \n\n\tseparated by blank...don't enter anything if you don't want to download!\n\nPlease enter:[NONE]"; + +my @dbnames = split(/\s+/,<>); +for (my $i=0;$i<@dbnames;$i++) +{ + if (uc($dbnames[$i]) eq "ALL" ) + { + foreach my $key (keys %flags) + { + $flags{$key}=1; + } + last; + } + + if( exists $flags{$dbnames[$i]}) + { + $flags{$dbnames[$i]} = 1; + } + #system ("wget http://rulai.cshl.edu/splicetrap/db/") +} + +foreach my $key (keys %flags) +{ + if ($flags{$key} ==1) + { + system ("wget http://rulai.cshl.edu/splicetrap/db/".$key.".tar.gz"); + print "untar the database file for $key...please wait..."; + system ("tar -ixzf $key.tar.gz"); + system ("rm $key.tar.gz"); + mkdir "$key/parallel"; + print "creating files for parallel computing...\n"; + system("bash $PROG_ABS_PATH/splitdb.sh $key/parallel") + } +}