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

View of /FigKernelScripts/pg_make_reaction_properties.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Jul 17 14:52:09 2013 UTC (6 years, 4 months ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2014_0729, rast_rel_2014_0912, HEAD
make reaction properties to paint tree

use strict;
use Data::Dumper;
use Getopt::Long;

my $dataD;

my $rc  = GetOptions('d=s' => \$dataD);

if ((! $rc) || 
    (! -d $dataD))
{ 
    die "usage: pg_make_reaction_properties -d Data";
}

my %reactions;

my %genomes;
foreach $_ (`cat anno.seed pubseed.seed | cut -f2`)
{
    chomp;
    $genomes{$_} = 1;
}
while (defined($_ = <STDIN>))
{
    if ($_ =~ /(\d+\.\d+).*(rxn\d+)/)
    {
	$reactions{$2}->{$1} = 1;
    }
}

foreach my $reaction (sort keys(%reactions))
{
    foreach my $g (sort { $a <=> $b } keys(%genomes))
    {
	if (! $reactions{$reaction}->{$g})
	{
	    $reactions{$reaction}->{$g} = 0;
	}
    }
    foreach my $g (sort { $a <=> $b } keys(%genomes))
    {
	print join("\t",($reaction,$g,$reactions{$reaction}->{$g})),"\n";
    }
}

    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3