| 1 | #!/usr/bin/env perl | ||
| 2 | # PODNAME: setup-taxdir.pl | ||
| 3 | # ABSTRACT: Setup a local mirror of the NCBI Taxonomy (or GTDB) database | ||
| 4 | |||
| 5 | use Modern::Perl '2011'; | ||
| 6 | use autodie; | ||
| 7 | |||
| 8 | use Getopt::Euclid qw(:vars); | ||
| 9 | use Smart::Comments; | ||
| 10 | |||
| 11 | use Bio::MUST::Core; | ||
| 12 | use aliased 'Bio::MUST::Core::Taxonomy'; | ||
| 13 | |||
| 14 | unless ($ARGV_update_cache) { | ||
| 15 | my %args; | ||
| 16 | $args{gi_mapper} = 1 if $ARGV_gi_mapper; | ||
| 17 | $args{source } = $ARGV_source; | ||
| 18 | Taxonomy->setup_taxdir($ARGV_taxdir, \%args); | ||
| 19 | } | ||
| 20 | |||
| 21 | my $tax = Taxonomy->new( tax_dir => $ARGV_taxdir ); | ||
| 22 | $tax->update_cache; | ||
| 23 | |||
| 24 | __END__ |