annotate pmlst.pl @ 0:cfab64885f66 draft default tip

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