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

Annotation of /FigKernelScripts/changed_starts.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3