[Bio] / Sprout / PropertySproutLoader.pm Repository:
ViewVC logotype

Diff of /Sprout/PropertySproutLoader.pm

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

revision 1.1, Thu Oct 9 18:16:26 2008 UTC revision 1.2, Mon Jan 19 21:46:21 2009 UTC
# Line 42  Line 42 
42    
43  [[SproutPm]] object for the database being loaded.  [[SproutPm]] object for the database being loaded.
44    
 =item source  
   
 [[FigPm]] object used to access the source data. If this parameter is undefined,  
 it will be created the first time the L</source> method is called.  
   
45  =item options  =item options
46    
47  Reference to a hash of command-line options.  Reference to a hash of command-line options.
# Line 61  Line 56 
56    
57  sub new {  sub new {
58      # Get the parameters.      # Get the parameters.
59      my ($class, $erdb, $source, $options) = @_;      my ($class, $erdb, $options) = @_;
60      # Create the table list.      # Create the table list.
61      my @tables = sort qw(Property HasProperty);      my @tables = sort qw(Property HasProperty);
62      # Create the BaseSproutLoader object.      # Create the BaseSproutLoader object.
63      my $retVal = BaseSproutLoader::new($class, $erdb, $source, $options, @tables);      my $retVal = BaseSproutLoader::new($class, $erdb, $options, @tables);
64      # Return it.      # Return it.
65      return $retVal;      return $retVal;
66  }  }
# Line 89  Line 84 
84      my $fig = $self->source();      my $fig = $self->source();
85      # All of the property stuff is done globally.      # All of the property stuff is done globally.
86      if ($self->global()) {      if ($self->global()) {
87          # Get the list of attributes we need for these searches. Currently, it's only          # Get the list of attributes we need for these searches. Currently, it's
88          # essentials.          # essentials and PFAM.
89          my @keys = $fig->get_group_keys('essential');          my @keys = $fig->get_group_keys('essential');
90            push @keys, 'PFAM';
91          # Get a hash of genome IDs.          # Get a hash of genome IDs.
92          my %genomes = map { $_ => 1 } $self->GetSectionList();          my %genomes = map { $_ => 1 } BaseSproutLoader::GetSectionList($sprout, $fig);
93          # This will be where we compute the property IDs.          # This will be where we compute the property IDs.
94          my %propIDs = ();          my %propIDs = ();
95          my $nextID = 1;          my $nextID = 1;
96          # Loop through these keys, getting feature IDs.          # Loop through these keys, getting feature IDs.
97          for my $key (@keys) {          for my $key (@keys) {
98              # Get all the attributes for this key.              # Get all the attributes for this key.
99                $self->Track(keys => $key, 10);
100              my @attributes = $fig->get_attributes(undef, $key);              my @attributes = $fig->get_attributes(undef, $key);
101              Trace(scalar(@attributes) . " attribute values found for $key.") if T(3);              Trace(scalar(@attributes) . " attribute values found for $key.") if T(3);
102              $self->Add('attribute-keys' => 1);              $self->Add('attribute-keys' => 1);
# Line 110  Line 107 
107                  # Default the URL to an empty string.                  # Default the URL to an empty string.
108                  $url = "" if ! defined $url;                  $url = "" if ! defined $url;
109                  # Only proceed if the peg ID is valid and for a known genome.                  # Only proceed if the peg ID is valid and for a known genome.
110                  if ($pegID =~ /^fig\|(\d+\.\d+)/ && $genomes{%1}) {                  if ($pegID =~ /^fig\|(\d+\.\d+)/ && $genomes{$1}) {
111                      # It is. Compute the property ID.                      # It is. Compute the property ID.
112                      my $propertyKeyValue = "$key::$value";                      my $propertyKeyValue = "$key::$value";
113                      my $propID = $propIDs{$propertyKeyValue};                      my $propID = $propIDs{$propertyKeyValue};

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3