#!/usr/bin/env perl
$Bio::MLST::Bin::Download::VERSION
=
'2.1.1706216'
;
BEGIN {
unshift
(
@INC
,
'../lib'
) }
use
lib
"/software/pathogen/internal/prod/lib"
;
my
(
$config_file
,
$base_directory
,
$url
,
$species
,
$gene_name
,
$help
,
$version
);
GetOptions (
'u|url=s'
=> \
$url
,
'b|base_directory=s'
=> \
$base_directory
,
's|species=s'
, => \
$species
,
'g|gene_name=s'
, => \
$gene_name
,
'h|help'
=> \
$help
,
'v|version'
=> \
$version
,
);
(!
$version
) or
die
"$0 version "
. Bio::MLST::Bin::Download->VERSION .
"\n"
;
(!
$help
)or
die
<<USAGE;
Usage: $0 [options]
Downloads all the MLST databases to disk
# download everything with defaults
download_mlst_databases
# print version information
download_mlst_databases -v
# XML file containing details of the MLST databases (from pubmlst)
download_mlst_databases -c my_config_file.json
# Pass in a different url to download
# destination base directory defaults to the environment variable \$MLST_DATABASES
download_mlst_databases -b /path/to/destination
USAGE
;
$base_directory
||=
$ENV
{MLST_DATABASES};
$base_directory
||=
'/lustre/scratch108/pathogen/pathpipe/mlst'
;
$species
||=
'Streptococcus pyogenes emm'
;
$gene_name
||=
'emm'
;
my
$convert_fasta
= Bio::MLST::CDC::Convert->new(
species
=>
$species
,
input_file
=>
$url
,
gene_name
=>
$gene_name
,
base_directory
=>
$base_directory
);
$convert_fasta
->create_mlst_files();