[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

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

revision 1.448, Tue Mar 21 15:53:30 2006 UTC revision 1.449, Wed Mar 22 16:31:15 2006 UTC
# Line 11878  Line 11878 
11878    
11879  ################################# Subsystems  ####################################  ################################# Subsystems  ####################################
11880    
11881    =head2 active_subsystems
11882    
11883    Get all subsystems that a genome is present in.
11884    
11885    Returns a hash with the keys being the subsystem and the values being the variant code
11886    
11887    my $hash=$fig->active_subsystems(83333.1);
11888    my $hash=$fig->active_subsystems(83333.1, "all");
11889    
11890    If the optional boolean "all" is true returns all variant codes, otherwise returns only non-zero and non-minus one
11891    
11892    =cut
11893    
11894    
11895  sub active_subsystems {  sub active_subsystems {
11896      my($self,$genome) = @_;      my($self,$genome,$all) = @_;
11897      my($active,$file,$variant);      my($active,$file,$variant);
11898    
11899      $active = {};      $active = {};
11900      foreach $_ (`grep \"^$genome\" $FIG_Config::data/Subsystems/*/spreadsheet`)      foreach $_ (`grep \"^$genome\" $FIG_Config::data/Subsystems/*/spreadsheet`)
11901      {      {
11902          if (($_ =~ /^(.*?)\/spreadsheet:$genome\t(\S+)/) && ($2 ne '0') && ($2 ne '-1'))          if (($_ =~ /^(.*?)\/spreadsheet:$genome\t(\S+)/))
11903          {          {
11904                next if (!($all) && (($2 eq '0') || ($2 eq '-1')));
11905              $file = $1;              $file = $1;
11906              $variant = $2;              $variant = $2;
11907              if ($file =~ /^.*?([^\/]+)$/)              if ($file =~ /^.*?([^\/]+)$/)

Legend:
Removed from v.1.448  
changed lines
  Added in v.1.449

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3