annotate pmlst.pl @ 0:140d4f9e1f20 draft default tip

Uploaded
author dcouvin
date Mon, 06 Sep 2021 16:00:46 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
1 #!/usr/bin/perl -w
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
2 use strict;
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
3 use warnings;
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
4
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
5 my $STpmlst = "";
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
6
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
7 my $path = $ARGV[0];
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
8 my $seq = $ARGV[1];
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
9 my $scheme = $ARGV[2];
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
10
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
11
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
12 open PMLST, "python3 $path/pmlst/pmlst.py -i $seq -s $scheme -p $path/pmlst/pmlst_db/ |";
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
13 while (<PMLST>) {
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
14 chomp ($_);
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
15 if ($_ =~ "sequence_type") {
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
16 #print "ST:$_ \n";
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
17 my @table = split (/:/,$_);
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
18 $STpmlst = $table [1];
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
19 #chomp ($STpmlst); $STpmlst = chop($STpmlst);
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
20 $STpmlst =~ s/\s+//;
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
21 $STpmlst = substr($STpmlst,1);
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
22 my @table2 = split (/'/,$STpmlst);
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
23 $STpmlst = $table2[0];
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
24 #print "$STpmlst\n" ;
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
25 }
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
26 }
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
27
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
28 #print "Sequence\tSequence Type (pMLST)\n" ;
140d4f9e1f20 Uploaded
dcouvin
parents:
diff changeset
29 print "pMLST for $seq:\t$STpmlst\n" ;