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

Diff of /FigKernelPackages/Subsystem.pm

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

revision 1.86, Sun Apr 2 16:57:10 2006 UTC revision 1.87, Fri May 12 12:05:55 2006 UTC
# Line 1546  Line 1546 
1546      return ref($rlist) ? @$rlist : ();      return ref($rlist) ? @$rlist : ();
1547  }  }
1548    
1549    
1550  sub roles_with_abbreviations  sub roles_with_abbreviations
1551  {  {
1552      my($self) = @_;      my($self) = @_;
# Line 2960  Line 2961 
2961  Returns the set of genes for a functional role that belong to  Returns the set of genes for a functional role that belong to
2962  genomes with functional variants (> 0).  genomes with functional variants (> 0).
2963    
2964    If the flag $strict is set to true,
2965    an additional check for the correct function assignment is performed.
2966    If the name of the functional role does not occur exaclty in the
2967    latest function assignment of the PEG, it is not included in the
2968    returned array. A simple index check is done.
2969    
2970  =cut  =cut
2971    
2972  sub functional_role_instances {  sub functional_role_instances {
2973    
2974      my ($self, $role) = @_;      my ($self, $role, $strict) = @_;
2975      my $i =0;      my $i =0;
2976    
2977      my @instances;      my @instances;
# Line 2973  Line 2980 
2980    
2981          if ((scalar @$cell > 0) && ($self->get_variant_code($i) > 0)) {          if ((scalar @$cell > 0) && ($self->get_variant_code($i) > 0)) {
2982              foreach (@$cell) {              foreach (@$cell) {
2983    
2984    
2985                    unless ($strict) {
2986                        push @instances, $_;
2987                    } else {
2988                        # check if the peg is still in sync with the role assignment
2989                        # will tolerate multiple role assignments but no mismatches
2990                        my $current_function = $self->{fig}->function_of($_);
2991                        if (index($current_function, $role) != -1) {
2992                  push @instances, $_;                  push @instances, $_;
2993                        } else {
2994                            print STDERR "[Warning] Function of $_ out of sync for role $role in subsystem ".$self->get_name()."\n";
2995                        }
2996                    }
2997              }              }
2998          }          }
2999          $i++;          $i++;

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.87

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3