Created
November 5, 2014 19:39
-
-
Save pcantalupo/00384ffef49c77b62d80 to your computer and use it in GitHub Desktop.
Download and extract NCBI taxonomy files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| my $base = "ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/"; | |
| my @files = qw/gi_taxid_nucl.dmp.gz | |
| gi_taxid_prot.dmp.gz | |
| taxdump.tar.gz | |
| taxcat.tar.gz/; | |
| foreach my $file (@files) { | |
| my $ftpfile = $base . $file; | |
| print "Getting $file ($ftpfile)\n"; | |
| system ("wget", $ftpfile); | |
| print "Extracting $file\n"; | |
| if ($file =~ /tar.gz$/) { | |
| system("tar","xvzf", $file); | |
| } | |
| else { | |
| system ("gunzip", "-f", $file); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment