diff getmlst.pl @ 0:c2e910327131 draft default tip

planemo upload commit 132092ff7fe1c4810d1221054419389180b81657
author nml
date Fri, 17 Nov 2017 11:49:10 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/getmlst.pl	Fri Nov 17 11:49:10 2017 -0500
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Cwd;
+use File::Copy;
+
+my ($mlst_db, $mlst_defs, $species) = @ARGV;
+
+$species =~ s/__pd__/#/ig;
+
+my $command = "getmlst.py --species '$species'";
+
+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;