[Bio] / FigTutorial / gf2maps_and_subs.pl Repository:
ViewVC logotype

Annotation of /FigTutorial/gf2maps_and_subs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.1 use FIG;
2 :     my $fig = new FIG;
3 :    
4 :     use strict;
5 :     my($usage,$peg,$func,@roles,$role,@maps,$map);
6 :     my(%in_map,@maps_it_connects_to,@subsystems_it_is_in);
7 :     my($map_name,$subsystem);
8 :    
9 :     $usage = "usage: gf2maps_and_subs PEG";
10 :    
11 :     # The single input argument must be a FIG id, which is used to get the assigned function.
12 :     # The program then prints a list of maps to which the gene can be connected,
13 :     # followed by a list of subsystems that contain the gene.
14 :    
15 :     ($peg = shift @ARGV)
16 :     || die $usage;
17 :    
18 :     if (($func = $fig->function_of($peg)) && (! &FIG::hypo($func)))
19 :     {
20 :     @roles = $fig->roles_of_function($func);
21 :     foreach $role (@roles)
22 :     {
23 :     @maps = $fig->role_to_maps($role);
24 :     foreach $map (@maps)
25 :     {
26 :     $in_map{$map} = 1;
27 :     }
28 :     }
29 :    
30 : olson 1.2 @maps_it_connects_to = sort keys(%in_map);
31 : overbeek 1.1
32 :     if (@maps_it_connects_to > 0)
33 :     {
34 :     print "Maps that connect to $func\n\n";
35 :     foreach $map (@maps_it_connects_to)
36 :     {
37 :     $map_name = $fig->map_name($map);
38 :     print "$map\t$map_name\n";
39 :     }
40 :     print "\n";
41 :     }
42 :    
43 :     }
44 :     else
45 :     {
46 :     print STDERR "you need to give a valid PEG with a non-hypothetical function to connect to maps\n";
47 :     }
48 :    
49 :     @subsystems_it_is_in = $fig->peg_to_subsystems($peg);
50 :    
51 :     if (@subsystems_it_is_in > 0)
52 :     {
53 :     print "Subsystems that contain $peg\n\n";
54 :     foreach $subsystem (@subsystems_it_is_in)
55 :     {
56 :     print "$subsystem\n";
57 :     }
58 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3