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

Annotation of /FigKernelScripts/make_close.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.4 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.1
19 : overbeek 1.2 # usage: make_close [G1 G2 G3 ...]
20 :    
21 : overbeek 1.1 use FIG;
22 :     my $fig = new FIG;
23 :     $dist = 5000;
24 :    
25 : overbeek 1.2 my @genomes = (@ARGV > 0) ? @ARGV : $fig->genomes;
26 :    
27 :     foreach $genome (@genomes)
28 : overbeek 1.1 {
29 :     print STDERR "processing $genome\n";
30 :     if ($fig->is_prokaryotic($genome))
31 :     {
32 :     foreach $peg ($fig->all_features($genome,"peg"))
33 :     {
34 : olson 1.3 my($peg_gnum, $peg_pnum) = $fig->map_peg_to_ids($peg);
35 : overbeek 1.1 my $loc = $fig->feature_location($peg);
36 :     if ($loc)
37 :     {
38 :     my($contig,$beg,$end) = &FIG::boundaries_of($loc);
39 :     if ($contig && $beg && $end)
40 :     {
41 :     my $min = &FIG::min($beg,$end) - $dist;
42 :     my $max = &FIG::max($beg,$end) + $dist;
43 :     my $feat;
44 :     ($feat,undef,undef) = $fig->genes_in_region($genome,$contig,$min,$max);
45 :     foreach $fid (@$feat)
46 :     {
47 : olson 1.3
48 : overbeek 1.1 if (($fid ne $peg) && (&FIG::ftype($fid) eq "peg"))
49 :     {
50 : olson 1.3 my($fgnum, $fpnum) = $fig->map_peg_to_ids($fid);
51 :     print "$peg_gnum\t$peg_pnum\t$fgnum\t$fpnum\n";
52 : overbeek 1.1 }
53 :     }
54 :     }
55 :     }
56 :     }
57 :     }
58 :     }
59 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3