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

Diff of /Sprout/FeatureSaplingLoader.pm

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

revision 1.10, Wed Sep 29 18:00:40 2010 UTC revision 1.19, Tue Sep 13 21:07:59 2011 UTC
# Line 27  Line 27 
27      use HyperLink;      use HyperLink;
28      use AliasAnalysis;      use AliasAnalysis;
29      use LoaderUtils;      use LoaderUtils;
     use Digest::MD5;  
30      use SeedUtils;      use SeedUtils;
31        use gjoseqlib;
32        use MD5Computer;
33      use base 'BaseSaplingLoader';      use base 'BaseSaplingLoader';
34    
35  =head1 Sapling Feature Load Group Class  =head1 Sapling Feature Load Group Class
# Line 66  Line 67 
67      my ($class, $erdb, $options) = @_;      my ($class, $erdb, $options) = @_;
68      # Create the table list.      # Create the table list.
69      my @tables = sort qw(Feature FeatureEssential FeatureEvidence FeatureLink      my @tables = sort qw(Feature FeatureEssential FeatureEvidence FeatureLink
70                           FeatureVirulent IsOwnerOf IsLocatedIn Identifies                           FeatureVirulent IsOwnerOf IsLocatedIn IsIdentifiedBy
71                           Identifier IsNamedBy ProteinSequence Concerns                           Identifier IsNamedBy ProteinSequence Concerns
72                           IsAttachmentSiteFor Publication IsProteinFor                           IsAttachmentSiteFor Publication IsProteinFor
73                           Role RoleIndex IsFunctionalIn);                           Role RoleIndex IsFunctionalIn);
# Line 201  Line 202 
202          $self->Add(missingAliasFile => 1);          $self->Add(missingAliasFile => 1);
203          $aliasHash = {};          $aliasHash = {};
204      }      }
205        # Get all of this genome's protein sequences.
206        my %seqs = map { $_->[0] => $_->[2] } gjoseqlib::read_fasta("$FIG_Config::organisms/$genomeID/Features/peg/fasta");
207      # Get all of this genome's features.      # Get all of this genome's features.
208      my $featureList = $fig->all_features_detailed_fast($genomeID);      my $featureList = $fig->all_features_detailed_fast($genomeID);
209      # Loop through them.      # Loop through them.
# Line 266  Line 269 
269          # Connect the feature to its genome.          # Connect the feature to its genome.
270          $self->PutR(IsOwnerOf => $genomeID, $fid);          $self->PutR(IsOwnerOf => $genomeID, $fid);
271          # Connect the feature to its roles.          # Connect the feature to its roles.
272          my ($roles, $errors) = LoaderUtils::RolesForLoading($assignment);          my ($roles, $errors) = SeedUtils::roles_for_loading($assignment);
273          if (! defined $roles) {          if (! defined $roles) {
274              # Here the functional assignment was suspicious.              # Here the functional assignment was suspicious.
275              $self->Add(suspiciousFunction => 1);              $self->Add(suspiciousFunction => 1);
# Line 324  Line 327 
327          my $proteinID;          my $proteinID;
328          if ($type eq 'peg') {          if ($type eq 'peg') {
329              # Get the translation.              # Get the translation.
330              my $proteinSequence = $fig->get_translation($fid);              my $proteinSequence = $seqs{$fid};
331              if (! $proteinSequence) {              if (! $proteinSequence) {
332                  Trace("No protein sequence found for $fid.") if T(2);                  Trace("No protein sequence found for $fid.") if T(ERDBLoadGroup => 2);
333                  $self->Add(missingProtein => 1);                  $self->Add(missingProtein => 1);
334                  # Here there was some sort of error and the protein sequence did                  # Here there was some sort of error and the protein sequence did
335                  # not come back. Ask for the DNA and translate it instead.                  # not come back. Ask for the DNA and translate it instead.
# Line 351  Line 354 
354          for my $aliasTuple (@$aliasList) {          for my $aliasTuple (@$aliasList) {
355              my ($aliasID, $aliasType, $aliasConf) = @$aliasTuple;              my ($aliasID, $aliasType, $aliasConf) = @$aliasTuple;
356              # Get the natural form. If there is none, then the canonical              # Get the natural form. If there is none, then the canonical
357              # form IS the natural form.              # form IS the natural form. Note we have to make a special check
358              my $natural = AliasAnalysis::Type($aliasType => $aliasID) || $aliasID;              # for locus tags, which have an insane number of variants.
359                my $natural;
360                if ($aliasID =~ /LocusTag:(.+)/) {
361                    $natural = $1;
362                } else {
363                    $natural = AliasAnalysis::Type($aliasType => $aliasID) || $aliasID;
364                }
365              # Create the identifier record.              # Create the identifier record.
366              $self->PutE(Identifier => $aliasID, natural_form => $natural,              $self->PutE(Identifier => $aliasID, natural_form => $natural,
367                          source => $aliasType);                          source => $aliasType);
# Line 362  Line 371 
371                  $self->PutR(IsNamedBy => $proteinID, $aliasID);                  $self->PutR(IsNamedBy => $proteinID, $aliasID);
372              } else {              } else {
373                  # No. Connect it to the feature.                  # No. Connect it to the feature.
374                  $self->PutR(Identifies => $aliasID, $fid, conf => $aliasConf);                  $self->PutR(IsIdentifiedBy => $fid, $aliasID, conf => $aliasConf);
375              }              }
376          }          }
377          # Finally, this feature is an alias of itself.          # Finally, this feature is an alias of itself.
378          $self->PutE(Identifier => $fid, natural_form => $fid,          $self->PutE(Identifier => $fid, natural_form => $fid,
379                      source => 'SEED');                      source => 'SEED');
380          $self->PutR(Identifies => $fid, $fid, conf => 'A');          $self->PutR(IsIdentifiedBy => $fid, $fid, conf => 'A');
381      }      }
382  }  }
383    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3