annotate parse_primersearch.pl @ 6:f201e8c6e004 draft default tip

Uploaded
author ben-warren
date Mon, 07 Jul 2014 19:28:17 -0400
parents b321e0517be3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
1 #!/usr/bin/perl
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
2 #parse_primersearch.pl
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
3 #reformat EMBOSS primersearch output into columnar Galaxy interval format
5
b321e0517be3 Uploaded
ben-warren
parents: 0
diff changeset
4 #usage perl parse_primersearch.pl <input primersearch file> <tabular output file>
0
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
5 #Copyright 2012 John McCallum
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
6 #New Zealand Institute for Plant and Food Research
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
7 #This program is free software: you can redistribute it and/or modify
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
10 # (at your option) any later version.
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
11 #
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
15 # GNU General Public License for more details.
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
16 #
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
19
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
20 open (IN, "<$ARGV[0]");
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
21 open (OUT, ">$ARGV[1]");
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
22
5
b321e0517be3 Uploaded
ben-warren
parents: 0
diff changeset
23
0
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
24
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
25
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
26
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
27 while (<IN>) {
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
28 /^Primer name (\S+)/ && ($name = $1); # get primer set name
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
29 # Modified to cope with unnamed sequence input 28/7/05
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
30 /Sequence: (\S+)/ && print OUT $name,"\t",$1;
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
31 /Sequence:(\s{4,})/ && print OUT $name,"\t","unnamed_seq";
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
32 /hits forward strand at (\d+) with (\d) mismatches/ && ($start = $1) && print OUT "\t",$2,"\t",$start,;
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
33 /Amplimer length: (\S+)/ && ($amp_length = $1) && print OUT "\t",$start + $amp_length,"\t",$1,"\n";
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
34 }
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
35
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
36 close( IN );
21053f7f9ed1 First upload of PCR Marker tools
john-mccallum
parents:
diff changeset
37 close( OUT );