[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.123, Wed Mar 19 22:54:44 2008 UTC revision 1.124, Thu Mar 20 19:28:37 2008 UTC
# Line 31  Line 31 
31  use strict;  use strict;
32    
33  my $notes_separator = "###############################";  my $notes_separator = "###############################";
34  my @section_order = qw(description notes literature);  my @section_order = qw(description notes literature variants);
35  my %defined_sections = map { $_ => 1 } @section_order;  my %defined_sections = map { $_ => 1 } @section_order;
36    
37  =head1 Subsystem Manipulation  =head1 Subsystem Manipulation
# Line 1983  Line 1983 
1983  {  {
1984      my($self, $gidx, $val) = @_;      my($self, $gidx, $val) = @_;
1985      $self->{variant_code}->[$gidx] = $val;      $self->{variant_code}->[$gidx] = $val;
   
1986      #      #
1987      # Update the index for all the pegs in this row.      # Update the index for all the pegs in this row.
1988      # (only if we have a new database)      # (only if we have a new database)
# Line 3104  Line 3103 
3103      my($self, $genome) = @_;      my($self, $genome) = @_;
3104    
3105      my $idx = $self->get_genome_index($genome);      my $idx = $self->get_genome_index($genome);
3106      if (defined($idx))      if ( defined( $idx ) ) {
     {  
3107          warn "Genome $genome already present\n";          warn "Genome $genome already present\n";
3108          return $idx;          return $idx;
3109      }      }
# Line 3277  Line 3275 
3275      return $self->{description};      return $self->{description};
3276  }  }
3277    
3278    =head3 get_variants
3279    
3280        my $text = $sub->get_variants();
3281    
3282    Return the variants for this subsystem.
3283    
3284    =cut
3285    
3286    sub get_variants
3287    {
3288        my($self) = @_;
3289    
3290        my $text = $self->{variants};
3291        my %vars;
3292    
3293        my @lines = split( "\n", $text );
3294        foreach ( @lines ) {
3295          my ( $v, $d ) = split( "\t", $_ );
3296          $vars{ $v } = $d;
3297        }
3298    
3299        return \%vars;
3300    }
3301    
3302  =head3 get_literature  =head3 get_literature
3303    
3304      my $text = $sub->get_literature();      my $text = $sub->get_literature();
# Line 3563  Line 3585 
3585      $self->{description} = $desc;      $self->{description} = $desc;
3586  }  }
3587    
3588    sub set_variants
3589    {
3590        my($self, $var) = @_;
3591    
3592        my $text = '';
3593        foreach my $k ( sort keys %$var ) {
3594          $text .= "$k\t".$var->{ $k }."\n";
3595        }
3596    
3597        $self->{variants} = $text;
3598    }
3599    
3600  sub set_literature  sub set_literature
3601  {  {
3602      my($self, $lit) = @_;      my($self, $lit) = @_;

Legend:
Removed from v.1.123  
changed lines
  Added in v.1.124

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3