Skip to content

Commit

Permalink
Issue #25 | d/l permalink to latest CARD
Browse files Browse the repository at this point in the history
  • Loading branch information
tseemann committed Aug 15, 2018
1 parent 4ca9bdb commit 2f9220b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/abricate
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use Cwd qw(abs_path);
#..............................................................................
# Globals needed before --help etc

my $VERSION = "0.8.5";
my $VERSION = "0.8.6";
my $EXE = just_filename( $FindBin::RealScript );
my $AUTHOR = 'Torsten Seemann';
my $TWITTER = '@torstenseemann';
Expand Down
12 changes: 8 additions & 4 deletions bin/abricate-get_db
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use strict;
use FindBin;
use lib "$FindBin::RealBin/../perl5";
use Bio::SeqIO;
use Bio::Seq;
use Path::Tiny;
use File::Spec;
use File::Path qw(make_path remove_tree);
Expand Down Expand Up @@ -333,14 +334,17 @@ sub get_bacmet2 {

#..............................................................................
sub get_card {
# https://github.com/tseemann/abricate/issues/25
my $tarball = 'card.tar.bz2';
download(
'https://card.mcmaster.ca/download/0/broadstreet-v2.0.2.tar.gz',
"card.tar.bz2" # yes, it's really BZ2 not GZ ...
#'https://card.mcmaster.ca/download/0/broadstreet-v2.0.2.tar.gz',
'https://card.mcmaster.ca/latest/data',
$tarball # yes, it's really BZ2 not GZ ...
);
# my $fasta = "./nucleotide_fasta_protein_homolog_model.fasta";
my $jsonfile = "./card.json";
system("tar xf card.tar.bz2 $jsonfile");

system("tar", "xf", $tarball, $jsonfile)==0 or err("Problem with tar xf $tarball $jsonfile");
-r $jsonfile or err("Could not extract $jsonfile from $tarball");
# JSON
my $json = path($jsonfile)->slurp_utf8;
my $card = from_json( $json, { latin1=>1 } );
Expand Down

0 comments on commit 2f9220b

Please sign in to comment.