#!/usr/bin/perl -w use strict; use CGI qw(:standard); use CGI qw(param); # FLUX DISPLAY 2001/2002 # ----------------------------- # Yale Gerstein Bioinformatics : Jimmy Lin # # A program to display flux information # and information associated with organisms # please forgive the lazy and sloppy code # USER SPECIFICATIONS #my $treename='ribosome'; # name of order #my @treeorder=qw(Mgen Hinf); # specification of order my $input= param("disp"); # my $input2=param("disp2"); my @treedata; my @treedata2; if (!param("disp")){ $input="2"; } if (!param("disp2")){ $input2="2"; } my $end; my $i; my $infoline = ""; read_matrix("meta-table"); read_matrix2("meta-table2"); # locate_enzyme("$input"); print_info("$infoline"); sub print_info { my ($i)=@_; print <Metabolism Display EndOfStart my $hvar = `perl /web/genecensus/header/header.cgi tree`; print "$hvar"; print ""; print "
"; print "
"; #START TOP MENU print "
"; print ""; print ""; print ""; print ""; print ""; #MIDDLE print ""; #RIGHT COLUMN print ""; print ""; #BOTTOM ROW print ""; #MIDDLE print ""; #RIGHT COLUMN print ""; #END TABLE print "
LEFT COLUMNRIGHT COLUMN
NORMAL FLUX: "; for (my $m=2;$m<7;$m++){ if ($m eq $input){print"";} print "$treedata[1][$m] "; } print "
ABS FLUX: "; for (my $m=7;$m<12;$m++){ if ($m eq $input){print"";} print "$treedata[1][$m] "; } print "
EXPRESSION STDEV: "; for (my $m=2;$m<4;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "
"; for (my $m=4;$m<9;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "
EXPRESSION AVG: "; for (my $m=9;$m<11;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "
"; for (my $m=11;$m<17;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "
NORMAL FLUX: "; for (my $m=2;$m<7;$m++){ if ($m eq $input2){print"";} print "$treedata[1][$m] "; } print "
ABS FLUX: "; for (my $m=7;$m<12;$m++){ if ($m eq $input2){print"";} print "$treedata[1][$m] "; } print "
EXPRESSION STDEV: "; for (my $m=2;$m<4;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "
"; for (my $m=4;$m<9;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "
EXPRESSION AVG: "; for (my $m=9;$m<11;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "
"; for (my $m=11;$m<17;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "
Flux Std: "; for (my $m=17;$m<18;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "Avg PID: "; for (my $m=18;$m<19;$m++){ if ($m eq $input/100){print"";} print "$treedata2[1][$m] "; } print "
"; print "PID: "; for (my $m=12;$m<16;$m++){ if ($m eq $input){print"";} print "$treedata[1][$m] "; } print "
"; for (my $m=16;$m<20;$m++){ if ($m eq $input){print"";} print "$treedata[1][$m] "; } print "
Flux Std: "; for (my $m=17;$m<18;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "Avg PID: "; for (my $m=18;$m<19;$m++){ if ($m eq $input2/100){print"";} print "$treedata2[1][$m] "; } print "
"; print "PID: "; for (my $m=12;$m<16;$m++){ if ($m eq $input2){print"";} print "$treedata[1][$m] "; } print "
"; for (my $m=16;$m<20;$m++){ if ($m eq $input2){print"";} print "$treedata[1][$m] "; } print "
"; print "
"; print "
"; print ""; #RIGHT FRAME START print ""; #TABLE END print "
"; print ""; #NUMBER FRAME START print ""; #NUMBER FRAME END #PICTURE FRAME START print ""; #PICTURE FRAME END #NUMBER FRAME 2 START print ""; #NUMBER FRAME 2 END print "
"; my $kk=1; print ""; print ""; print ""; for (my $p=2;$p<20;$p++){ print ""; print ""; if ($input < 100){ if (($treedata[$p][$input] ne "N/A") and ($treedata[$p][$input] > 0.75)) { print "";} else{ if (($treedata2[$p][$input/100] ne "N/A") and ($treedata2[$p][$input/100] > 0.75)) { print ""; } print ""; } print "
ENZYME"; print "
"; #LABEL NAME if ($input<7){ print "NORM FLUX
"; }elsif ($input<12){ print "ABS FLUX
"; }elsif ($input<20){ print "PID
"; }elsif ($input<900){ print "STDEV
"; }elsif ($input<1700){ print "AVG
"; }else{ print "Value
"; } print "$treedata[1][$input]
"; print "
"; print "
$treedata[$p][1]
"; print "
";} elsif (($treedata[$p][$input] ne "N/A") and ($treedata[$p][$input] > 0.5)) { print "";} elsif (($treedata[$p][$input] ne "N/A") and ($treedata[$p][$input] > 0.25)) { print "";} elsif (($treedata[$p][$input] ne "N/A") and ($treedata[$p][$input] > 0)) { print "";} else{ print "";} print "
$treedata[$p][$input]
";} elsif (($treedata2[$p][$input/100] ne "N/A") and ($treedata2[$p][$input/100] > 0.5)) { print "";} elsif (($treedata2[$p][$input/100] ne "N/A") and ($treedata2[$p][$input/100] > 0.25)) { print "";} elsif (($treedata2[$p][$input/100] ne "N/A") and ($treedata2[$p][$input/100] > 0)) { print "";} else{ print "";} print "
$treedata2[$p][$input/100]
"; print "
"; print ""; print ""; # my $kk=1; print ""; print ""; print ""; for (my $p=2;$p<20;$p++){ print ""; print ""; if ($input2 < 100){ if (($treedata[$p][$input2] ne "N/A") and ($treedata[$p][$input2] > 0.75)) { print "";} else{ if (($treedata2[$p][$input2/100] ne "N/A") and ($treedata2[$p][$input2/100] > 0.75)) { print ""; } } print "
ENZYME"; print "
"; #LABEL NAME if ($input2<7){ print "NORM FLUX
"; }elsif ($input2<12){ print "ABS FLUX
"; }elsif ($input2<20){ print "PID
"; }elsif ($input2<900){ print "STDEV
"; }elsif ($input2<1700){ print "AVG
"; }else{ print "Value
"; } print "$treedata[1][$input2]
"; print "
"; print "
$treedata[$p][1]
"; print "
";} elsif (($treedata[$p][$input2] ne "N/A") and ($treedata[$p][$input2] > 0.5)) { print "";} elsif (($treedata[$p][$input2] ne "N/A") and ($treedata[$p][$input2] > 0.25)) { print "";} elsif (($treedata[$p][$input2] ne "N/A") and ($treedata[$p][$input2] > 0)) { print "";} else{ print "";} print "
$treedata[$p][$input2]
";} elsif (($treedata2[$p][$input2/100] ne "N/A") and ($treedata2[$p][$input2/100] > 0.5)) { print "";} elsif (($treedata2[$p][$input2/100] ne "N/A") and ($treedata2[$p][$input2/100] > 0.25)) { print "";} elsif (($treedata2[$p][$input2/100] ne "N/A") and ($treedata2[$p][$input2/100] > 0)) { print "";} else{ print "";} print "
$treedata2[$p][$input2/100]
"; print "
"; #RIGHT FRAME END print "
"; print "
"; } sub locate_enzyme { my ($name)=@_; $end-=2; for ($i=2; $i<$end; $i++) { # print "$treedata[$i][1]"; if ($input eq $treedata[$i][1]){ # print " BANG!"; $infoline=$i; } # print "\n"; } } sub read_matrix { my ($filename)=@_; open (DATA, "./$filename.txt") or die "cannot open $filename.txt"; my $tree_chunk; my @store_array; my $x=0; my $y=0; while () { $y=0; for $tree_chunk (split()){ # print "$tree_chunk "; $treedata[$x][$y]=$tree_chunk; $y++; } $end=$y; # print "\n"; $x++; } close DATA; } sub read_matrix2 { my ($filename)=@_; open (DATA, "./$filename.txt") or die "cannot open $filename.txt"; my $tree_chunk; my @store_array; my $x=0; my $y=0; while () { $y=0; for $tree_chunk (split()){ # print "$tree_chunk "; $treedata2[$x][$y]=$tree_chunk; $y++; } $end=$y; # print "\n"; $x++; } close DATA; }