[Bio] / FigKernelScripts / changed_starts.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/changed_starts.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download) (as text)

1 : overbeek 1.3 # -*- perl -*-
2 : overbeek 1.1
3 :     use FIG;
4 :    
5 :     $usage = "usage: changed_starts Proposed Annotations >> modified.starts";
6 :    
7 :     (
8 :     ($proposed = shift @ARGV) && open(PROPOSED,"<$proposed") &&
9 :     ($annotations = shift @ARGV) && open(ANN,">>$annotations")
10 :     )
11 :     || die $usage;
12 :    
13 :     $/ = "///\n";
14 :    
15 :     while (defined($entry = <PROPOSED>))
16 :     {
17 : overbeek 1.2 if ($entry =~ /ID=(\S+).*\nOLD_START_POS=(\d+)\nNEW_START_POS=(\d+).*?CONF_GAP=(\S+).*?NEW_START_LOC=(\S+)_(\d+)_(\d+)\n/s)
18 : overbeek 1.1 {
19 :     ($peg,$old_pos,$new_pos,$conf_gap,$contig,$beg,$end) = ($1,$2,$3,$4,$5,$6,$7);
20 :    
21 :     $old_beg = ($beg < $end) ? $beg - ($new_pos-$old_pos) : $beg + ($new_pos-$old_pos);
22 :     $old_start = join("_",($contig,$old_beg,$end));
23 :     $new_start = join("_",($contig,$beg,$end));
24 :     push(@changes,[$peg,$old_start,$new_start,$conf_gap]);
25 :     print ANN "$peg\tChanged start from $old_start to $new_start\n";
26 :     }
27 :     }
28 :    
29 :     foreach $_ (sort { $b->[3] <=> $a->[3] } @changes)
30 :     {
31 :     print join("\t",@$_),"\n";
32 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3