Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danpf/fix install deps #80

Merged
merged 2 commits into from
Jun 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions fragment_tools/install_dependencies.pl
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,18 @@
if (!$skip_nr && $database eq "nr" && ($overwrite || !-s "$datdir/nr.pal")) {
chdir($datdir);
print "Fetching NR database from NCBI. Be very patient ......\n";
system("wget -N http://www.ncbi.nlm.nih.gov/blast/docs/update_blastdb.pl");
die "ERROR! wget http://www.ncbi.nlm.nih.gov/blast/docs/update_blastdb.pl failed.\n" if (!-s "$datdir/update_blastdb.pl");
system("rm $datdir/nr*"); # clean up interrupted attempts
$SIG{INT} = \&clean_nr_tgz;
system("wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.9.0+-src.tar.gz");
system("tar -zxf ncbi-blast-2.9.0+-src.tar.gz");
system("cp ncbi-blast-2.9.0+-src/c++/src/app/blast/update_blastdb.pl .");
die "ERROR! wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-1.9.0+-src.tar.gz failed.\n" if (!-s "$datdir/update_blastdb.pl");
if ( -d "$datdir/nr" ) {
system("rm -rf $datdir/nr*"); # clean up interrupted attempts
$SIG{INT} = \&clean_nr_tgz;
}
# Sometimes fails randomly, run multiple times (sorry horrible hack)
system("perl $datdir/update_blastdb.pl nr");
system("perl $datdir/update_blastdb.pl nr");
system("perl $datdir/update_blastdb.pl nr");
(system("perl $datdir/update_blastdb.pl nr") == 0) or do { &clean_nr_tgz; };
$SIG{INT} = \&clean_nr;
foreach my $f (glob("$datdir/nr.*tar.gz")) {
Expand All @@ -288,16 +296,26 @@
# p_filt NR database from installed nr
if (!$skip_nr && ($overwrite || !-s "$datdir/nr_pfilt.pal")) {
chdir($datdir);
print "Generating nr fasta. Be very patient ......\n";
my $cmd = "$Bin/blast/bin/fastacmd -D 1 > $datdir/nr";
(system($cmd) == 0) or die "ERROR! $cmd failed.\n";
print "Generating nr_pfilt fasta. Be very very patient ......\n";
$cmd = "$Bin/psipred/bin/pfilt $datdir/nr > $datdir/nr_pfilt";
(system($cmd) == 0) or die "ERROR! $cmd failed.\n";
if (!-s "$datdir/nr") {
print "Generating nr fasta. Be very patient ......\n";
my $cmd = "$Bin/blast/bin/fastacmd -D 1 > $datdir/nr";
print $cmd;
(system($cmd) == 0) or die "ERROR! $cmd failed.\n";
}

if (!-s "$datdir/nr_pfilt") {
print "Generating nr_pfilt fasta. Be very very patient ......\n";
my $cmd = "$Bin/psipred/bin/pfilt $datdir/nr > $datdir/nr_pfilt";
print $cmd;
(system($cmd) == 0) or die "ERROR! $cmd failed.\n";
}

print "Formatting nr_pfilt fasta. Be very very very patient ......\n";
system("rm $datdir/nr_pfilt.*"); # clean up interrupted attempts
$SIG{INT} = \&clean_nr_pfilt;
(system("$Bin/blast/bin/formatdb -o T -i $datdir/nr_pfilt") == 0) or do { &clean_nr_pfilt; };
my $cmd = "$Bin/blast/bin/formatdb -o T -i $datdir/nr_pfilt -v 10000";
print $cmd;
(system($cmd) == 0) or do { &clean_nr_pfilt; };
$SIG{INT} = 'DEFAULT';
(-s "$datdir/nr_pfilt.pal") or die "ERROR! $datdir/nr_pfilt database installation failed!\n";
}
Expand Down