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

View of /FigKernelScripts/make_close.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Jun 20 19:04:32 2005 UTC (14 years, 11 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +5 -1 lines
generalize computation of close genes

# usage: make_close [G1 G2 G3 ...]

use FIG;
my $fig = new FIG;
$dist = 5000;

my @genomes = (@ARGV > 0) ? @ARGV : $fig->genomes;

foreach $genome (@genomes)
{
    print STDERR "processing $genome\n";
    if ($fig->is_prokaryotic($genome))
    {
	foreach $peg ($fig->all_features($genome,"peg"))
	{
	    my $loc = $fig->feature_location($peg);
	    if ($loc)
	    {
		my($contig,$beg,$end) = &FIG::boundaries_of($loc);
		if ($contig && $beg && $end)
		{
		    my $min = &FIG::min($beg,$end) - $dist;
		    my $max = &FIG::max($beg,$end) + $dist;
		    my $feat;
		    ($feat,undef,undef) = $fig->genes_in_region($genome,$contig,$min,$max);
		    foreach $fid (@$feat)
		    {
			if (($fid ne $peg) && (&FIG::ftype($fid) eq "peg"))
			{
			    print "$peg\t$fid\n";
			}
		    }
		}
	    }
	}
    }
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3