[Bio] / Sprout / GenomeStats.pl Repository:
ViewVC logotype

Diff of /Sprout/GenomeStats.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32, Sun Mar 23 16:10:47 2008 UTC revision 1.36, Mon Mar 2 22:25:08 2009 UTC
# Line 59  Line 59 
59  use File::Path;  use File::Path;
60  use Sprout;  use Sprout;
61  use SFXlate;  use SFXlate;
62  use CGI qw(:standard);  use CGI qw(-nosticky);
63  use FIG;  use FIG;
64  use WikiTools;  use WikiTools;
65    
# Line 105  Line 105 
105      # Get the super-group list.      # Get the super-group list.
106      my @superGroups = sort keys %newGroupHash;      my @superGroups = sort keys %newGroupHash;
107      # Set up some useful stuff for the four count columns.      # Set up some useful stuff for the four count columns.
108      my %linkParms = ( s0 => "nothypo_sub", n0 => "nothypo_nosub",      my $url = "%SCRIPTURL{rest}%/NmpdrPlugin/search?Class=OrgSumSearch;Search=Go";
109                        s1 => "hypo_sub", n1 => "hypo_nosub" );      my %linkParms = ( s0 => "$url;hypothetical=named;insubsystem=in;genome=",
110                          n0 => "$url;hypothetical=named;insubsystem=out;genome=",
111                          s1 => "$url;hypothetical=hypo;insubsystem=in;genome=",
112                          n1 => "$url;hypothetical=hypo;insubsystem=out;genome=" );
113      my @columnTypes = ('s0', 'n0', 's1', 'n1');      my @columnTypes = ('s0', 'n0', 's1', 'n1');
114      # Prepare a hash for the summary counters. These will be used on the organism summary page.      # Prepare a hash for the summary counters. These will be used on the organism summary page.
115      my %summaries = ();      my %summaries = ();
# Line 145  Line 148 
148          my @columnNames = "*Strain annotated in NMPDR*";          my @columnNames = "*Strain annotated in NMPDR*";
149          push @columnNames, map { "*$_*" } sort keys %specialData;          push @columnNames, map { "*$_*" } sort keys %specialData;
150          push @columnNames,  "*Genome size, bp*",          push @columnNames,  "*Genome size, bp*",
151                              " *[[FIG.ProteinEncodingGenes][Protein Encoding Genes]] (PEGs)*",                              " *%FIG{Protein Encoding Genes}% (PEGs)*",
152                              " *Named genes in subsystems*",            # s0                              " *Named genes in subsystems*",            # s0
153                              " *Named genes not in subsystems*",        # n0                              " *Named genes not in subsystems*",        # n0
154                              " *Hypothetical genes in subsystems*",     # s1                              " *Hypothetical genes in subsystems*",     # s1
155                              " *Hypothetical genes not in subsystems*", # n1                              " *Hypothetical genes not in subsystems*", # n1
156                              " *Subsystems*",                              " *Subsystems*",
157                              " *RNAs*";                              " *RNAs*";
158            # Make the table sortable.
159            push @outputLines, '%TABLE{sort="on"}%';
160          # Create the header row.          # Create the header row.
161          push @outputLines, "| " . join(" | ", @columnNames) . " |";          push @outputLines, "| " . join(" | ", @columnNames) . " |";
162          # The data rows will be built next. We'll be putting them into a hash keyed by          # The data rows will be built next. We'll be putting them into a hash keyed by
# Line 217  Line 222 
222                  $groupTotals{$counterKey} += $counters{$counterKey};                  $groupTotals{$counterKey} += $counters{$counterKey};
223              }              }
224              $groupTotals{features} += $totalFeatures;              $groupTotals{features} += $totalFeatures;
225              # We have all our data. Next we need to compute the percentages and the links.              # We have all our data. Next we need to compute the percentages.
             # First, the link stuff.  
             my $linkPrefix = "%NMPDR{FIG/genome_statistics.cgi}%?user=;genome=$genomeID;SPROUT=1;request=";  
             # Now format the counters and percentages.  
226              for my $type (keys %linkParms) {              for my $type (keys %linkParms) {
227                  $counters{$type} = a( { href => "$linkPrefix$linkParms{$type}" },                  my $counterData = sprintf("%d(%.1f%%)", $counters{$type},
228                                       sprintf("%d(%.1f%%)", $counters{$type},                                            Tracer::Percent($counters{$type}, $totalFeatures));
229                                               Tracer::Percent($counters{$type}, $totalFeatures)));                  $counters{$type} = CGI::a({ href => $linkParms{$type} . $genomeID }, $counterData);
230              }              }
231              my @counterValues = map { $counters{$_} } @columnTypes;              my @counterValues = map { $counters{$_} } @columnTypes;
232              # The last link is a button to look at the subsystem summaries.              # The last column is a subsystem count.
233              my $ssCount = $sprout->GetCount(['ParticipatesIn'], 'ParticipatesIn(from-link) = ?',              my $ssCount = $sprout->GetCount(['ParticipatesIn'], 'ParticipatesIn(from-link) = ?',
234                                                 [$genomeID]);                                                 [$genomeID]);
235              my $ssLink = "$options->{linkCGI}?user=\&genome=$genomeID&SPROUT=1&show_subsystems=1";              my $ssCol = $ssCount;
             my $ssCol = "<a href=\"$ssLink\">$ssCount</a>";  
236              # Start creating the table cells.              # Start creating the table cells.
237              my $rowHtml = "| $genomeText |";              my $rowHtml = "| $genomeText |";
238              # Add any special columns.              # Add any special columns.

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.36

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3