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

Diff of /Sprout/SynonymSproutLoader.pm

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

revision 1.1, Thu Oct 9 18:13:09 2008 UTC revision 1.2, Mon Jan 19 21:46:21 2009 UTC
# Line 32  Line 32 
32    
33  =head3 new  =head3 new
34    
35      my $sl = SynonymSproutLoader->new($erdb, $source, $options, @tables);      my $sl = SynonymSproutLoader->new($erdb, $options, @tables);
36    
37  Construct a new SynonymSproutLoader object.  Construct a new SynonymSproutLoader object.
38    
# 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(SynonymGroup SynonymGroupFor);      my @tables = sort qw(SynonymGroup IsSynonymGroupFor);
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 95  Line 90 
90          my $dbh = $fig->db_handle();          my $dbh = $fig->db_handle();
91          # Ask for the synonyms. Note that "maps_to" is a group name, and "syn_id" is a PEG ID or alias.          # Ask for the synonyms. Note that "maps_to" is a group name, and "syn_id" is a PEG ID or alias.
92          my $sth = $dbh->prepare_command("SELECT maps_to, syn_id FROM peg_synonyms WHERE syn_id LIKE ?");          my $sth = $dbh->prepare_command("SELECT maps_to, syn_id FROM peg_synonyms WHERE syn_id LIKE ?");
93          my $result = $sth->execute("FIG|$genomeID%");          my $result = $sth->execute("fig|$genomeID%");
94          if (! defined($result)) {          if (! defined($result)) {
95              Confess("Database error in Synonym load: " . $sth->errstr());              Confess("Database error in Synonym load: " . $sth->errstr());
96          } else {          } else {
# Line 107  Line 102 
102                  # Count this row.                  # Count this row.
103                  $self->Add('synonyms-read' => 1);                  $self->Add('synonyms-read' => 1);
104                  # Insure it's not deleted.                  # Insure it's not deleted.
105                  if ($fig->is_deleted_fig($peg)) {                  if ($fig->is_deleted_fid($peg)) {
106                      $self->Add('synonyms-skipped' => 1);                      $self->Add('synonyms-skipped' => 1);
107                  } else {                  } else {
108                      # Create the group record.                      # Create the group record.
109                      $self->PutE(SynonymGroup => $syn_id);                      $self->PutE(SynonymGroup => $syn_id);
110                      # Connect the synonym to the peg.                      # Connect the synonym to the peg.
111                      $self->PutR(SynonymGroup => $syn_id, $peg);                      $self->PutR(IsSynonymGroupFor => $syn_id, $peg);
112                  }                  }
113              }              }
114          }          }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3