0
|
1 #!usr/bin/env perl
|
|
2
|
|
3 use strict;
|
|
4 use warnings;
|
|
5 use Cwd;
|
|
6 use File::Copy;
|
|
7
|
|
8 my ($binary, $mlst_db, $mlst_defs, $species) = @ARGV;
|
|
9
|
1
|
10 $species =~ s/__pd__/#/ig;
|
0
|
11
|
|
12 my $command = "python $binary --species '$species'"; #add proper spaces to command
|
|
13
|
|
14 my $rv = system($command);
|
|
15
|
|
16 if ($rv == 0)
|
|
17 {
|
|
18 #need to find output files in the dir
|
|
19 my $cur_dir = getcwd();
|
|
20
|
|
21 foreach my $file (<$cur_dir/*>)
|
|
22 {
|
|
23 if ($file =~ /\.fasta$/)
|
|
24 {
|
|
25 move($file, $mlst_db);
|
|
26 }
|
|
27 elsif ($file =~/\.txt$/)
|
|
28 {
|
|
29 move($file, $mlst_defs);
|
|
30 }
|
|
31 }
|
|
32 }
|
|
33 $rv = $rv >> 8;
|
|
34 exit $rv;
|
|
35
|