[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.10, Sun Jun 18 08:52:31 2006 UTC revision 1.18, Thu Aug 10 07:34:13 2006 UTC
# Line 112  Line 112 
112  } elsif (! -d $targetDir) {  } elsif (! -d $targetDir) {
113      Confess("Target directory $targetDir not found.");      Confess("Target directory $targetDir not found.");
114  } else {  } else {
115      # *Get the old Sprout.      # Get the old Sprout.
116      my $oldSprout = SFXlate->new_sprout_only($FIG_Config::oldSproutDB);      my $oldSprout = SFXlate->new_sprout_only($FIG_Config::oldSproutDB);
117      # Extract the genome group data from the old Sprout.      # Extract the genome group data from the old Sprout.
118      my %oldGroupHash = $oldSprout->GetGroups();      my %oldGroupHash = $oldSprout->GetGroups();
# Line 137  Line 137 
137              %oldGenomes = map { $_ => 1 } @{$oldGroupHash{$groupID}};              %oldGenomes = map { $_ => 1 } @{$oldGroupHash{$groupID}};
138          }          }
139          # Create the output file.          # Create the output file.
140          Open(\*GROUPFILE, ">$targetDir/$groupID.inc");          my $outFileName = "stats-" . lc($groupID) . ".inc";
141            Open(\*GROUPFILE, ">$targetDir/$outFileName");
142          # Get the styles.          # Get the styles.
143          my ($tableStyle, $markerStyle, @rowStyle) = ($options->{tableStyle}, $options->{markerStyle},          my ($tableStyle, $markerStyle, @rowStyle) = ($options->{tableStyle}, $options->{markerStyle},
144                                                       $options->{evenStyle}, $options->{oddStyle});                                                       $options->{evenStyle}, $options->{oddStyle});
# Line 155  Line 156 
156                                                   "RNAs",                                                   "RNAs",
157                                                     ])) . "\n";                                                     ])) . "\n";
158          # Set up some useful stuff for the four count columns.          # Set up some useful stuff for the four count columns.
159          my %linkParms = ( s0 => "nohypo_sub", n0 => "nohypo_nosub",          my %linkParms = ( s0 => "nothypo_sub", n0 => "nothypo_nosub",
160                            s1 => "hypo_sub", n1 => "hypo_nosub" );                            s1 => "hypo_sub", n1 => "hypo_nosub" );
161          my @columnTypes = ('s0', 'n0', 's1', 'n1');          my @columnTypes = ('s0', 'n0', 's1', 'n1');
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 173  Line 174 
174                  $new = " <span class=\"$markerStyle\">NEW!</span>";                  $new = " <span class=\"$markerStyle\">NEW!</span>";
175              }              }
176              # Get the genome length.              # Get the genome length.
177              my $genomeLen = $sprout->GenomeLength($genomeID);              my $genomeLen = Tracer::CommaFormat($sprout->GenomeLength($genomeID));
178              # Get the number of PEGs.              # Get the number of PEGs.
179              my $pegCount = $sprout->FeatureCount($genomeID, 'peg');              my $pegCount = Tracer::CommaFormat($sprout->FeatureCount($genomeID, 'peg'));
180              # Get the number of RNAs.              # Get the number of RNAs.
181              my $rnaCount = $sprout->FeatureCount($genomeID, 'rna');              my $rnaCount = Tracer::CommaFormat($sprout->FeatureCount($genomeID, 'rna'));
182                # If there are no RNAs, we say we don't know the number, since we know there
183                # must be RNAs somewhere.
184                if (! $rnaCount) {
185                    $rnaCount = "n/d";
186                }
187              # Now we have four categories of features to work with, for each              # Now we have four categories of features to work with, for each
188              # combination of named or hypothetical vs. in-subsystem or              # combination of named or hypothetical vs. in-subsystem or
189              # not-in-subsystem. First, we get all of the feature assignments for              # not-in-subsystem. First, we get all of the feature assignments for
190              # the genome.              # the genome.
191              my $assignHash = $sprout->GenomeAssignments($genomeID);              my $assignHash = $sprout->GenomeAssignments($genomeID);
192              # Next, we get all of the features in the genome that belong to a              # Next, we get all of the features in the genome that belong to a
193              # subsystem. This involves a query via the subsystem spreadsheet.              # subsystem.
194              my %ssHash = map { $_ => 1 } $sprout->GetFlat(['IsGenomeOf', 'ContainsFeature'],              my %ssHash = $sprout->GenomeSubsystemData($genomeID);
                                                     "IsGenomeOf(from-link) = ?",  
                                                     [$genomeID], 'ContainsFeature(to-link)');  
195              # Create a hash to track the four categories. "s" or "n" indicates              # Create a hash to track the four categories. "s" or "n" indicates
196              # in or out of a subsystem. "1" or "0" indicates hypothetical or              # in or out of a subsystem. "1" or "0" indicates hypothetical or
197              # real.              # real.

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.18

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3