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

View of /FigKernelScripts/changed_starts.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Jul 28 17:45:37 2005 UTC (14 years, 10 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +1 -1 lines
modifications to correcting starts code

use FIG;

$usage = "usage: changed_starts Proposed Annotations >> modified.starts";

(
 ($proposed    = shift @ARGV) && open(PROPOSED,"<$proposed") &&
 ($annotations = shift @ARGV) && open(ANN,">>$annotations") 
)
    || die $usage;

$/ = "///\n";

while (defined($entry = <PROPOSED>))
{
    if ($entry =~ /ID=(\S+).*\nOLD_START_POS=(\d+)\nNEW_START_POS=(\d+).*?CONF_GAP=(\S+).*?NEW_START_LOC=(\S+)_(\d+)_(\d+)\n/s)
    {
	($peg,$old_pos,$new_pos,$conf_gap,$contig,$beg,$end) = ($1,$2,$3,$4,$5,$6,$7);

	$old_beg = ($beg < $end) ? $beg - ($new_pos-$old_pos) : $beg + ($new_pos-$old_pos);
	$old_start = join("_",($contig,$old_beg,$end));
	$new_start = join("_",($contig,$beg,$end));
	push(@changes,[$peg,$old_start,$new_start,$conf_gap]);
	print ANN "$peg\tChanged start from $old_start to $new_start\n";
    }
}

foreach $_ (sort { $b->[3] <=> $a->[3] } @changes)
{
    print join("\t",@$_),"\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3