diff getmlst.pl @ 0:a6503f48b2be draft

Uploaded
author jen-cabral
date Wed, 04 Feb 2015 14:47:54 -0500
parents
children f1435033144b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/getmlst.pl	Wed Feb 04 14:47:54 2015 -0500
@@ -0,0 +1,35 @@
+#!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;
+