Mercurial > repos > nml > getmlst
view getmlst.pl @ 2:0f31ef2dfdde draft default tip
Uploaded
author | jen-cabral |
---|---|
date | Wed, 04 Feb 2015 15:10:17 -0500 |
parents | f1435033144b |
children |
line wrap: on
line source
#!usr/bin/env perl use strict; use warnings; use Cwd; use File::Copy; my ($binary, $mlst_db, $mlst_defs, $species) = @ARGV; $species =~ s/__pd__/#/ig; my $command = "python $binary --species '$species'"; #add proper spaces to command my $rv = system($command); if ($rv == 0) { #need to find output files in the dir my $cur_dir = getcwd(); foreach my $file (<$cur_dir/*>) { if ($file =~ /\.fasta$/) { move($file, $mlst_db); } elsif ($file =~/\.txt$/) { move($file, $mlst_defs); } } } $rv = $rv >> 8; exit $rv;