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

Annotation of /FigKernelScripts/pg_get_reaction_role.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.1 use strict;
2 :     use Data::Dumper;
3 :     use Getopt::Long;
4 :     use SeedEnv;
5 :     use JSON::XS;
6 :    
7 :     my $usage = "usage: get_reaction_roles -d Data\n";
8 :     my $dataD;
9 :     my $rc = GetOptions('d=s' => \$dataD,);
10 :    
11 :     if ((! $rc) || (! -d $dataD)) { print STDERR $usage; exit }
12 :    
13 :     #load up source id -> id, source id, cplx, role
14 :     my @rx_role = `all_entities_Reaction -f source_id | get_relationship_IsStepOf -c 1 -to id | get_relationship_IsTriggeredBy -to id`;
15 :     my %rxroleH;
16 :     foreach my $r (@rx_role) {
17 :     chomp $r;
18 :     my ($id, $source, $cpx, $role) = split ("\t", $r);
19 :     push (@{$rxroleH{$source}}, $r);
20 :     }
21 :    
22 :    
23 :     foreach $_ (`cat $dataD/MODEL-ID`)
24 :     {
25 :     if ($_ =~ /^(\S+)\t(\S+)/) {
26 :    
27 :     my($genome,$mid) = ($1,$2);
28 :     open(RX_IN," < $dataD/Reactions/$mid.reactions.list") || die "could not open $dataD/Reactions/$mid.reactions.list";
29 :     open(RX," > $dataD/Reactions/$mid.reactions.table") || die "could not open $dataD/Reactions/$mid.reactions.table";
30 :     while (<RX_IN>) {
31 :     chomp;
32 :     foreach my $r (@{$rxroleH{$_}}) {
33 :     print RX $r, "\n";
34 :     print $genome, "\t", $r, "\n";
35 :     }
36 :    
37 :     }
38 :     close(RX);
39 :     }
40 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3