[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.4, Tue Jun 30 19:53:01 2009 UTC revision 1.7, Wed Nov 25 21:00:45 2009 UTC
# Line 138  Line 138 
138          my ($fid, $locationString, $aliases, $type, undef, undef, $assignment,          my ($fid, $locationString, $aliases, $type, undef, undef, $assignment,
139              $assignmentMaker, $quality) = @$feature;              $assignmentMaker, $quality) = @$feature;
140          $self->Track(Features => $fid, 1000);          $self->Track(Features => $fid, 1000);
141          # Fix the assignment for non-PEG features.          # Fix missing assignments. For RNAs, the assignment may be in the alias list.
142          if (! defined $assignment) {          if (! defined $assignment) {
143                if ($type eq 'rna') {
144              $assignment = $aliases;              $assignment = $aliases;
145              $assignmentMaker ||= 'master';              $assignmentMaker ||= 'master';
146                } else {
147                    $assignment = '';
148                }
149          }          }
150          # Convert the location string to a list of location objects.          # Convert the location string to a list of location objects.
151          my @locs = map { BasicLocation->new($_) } split /\s*,\s*/, $locationString;          my @locs = map { BasicLocation->new($_) } split /\s*,\s*/, $locationString;
# Line 214  Line 218 
218          my @essentials = $fig->get_attributes($fid, undef, ['essential', 'potential-essential']);          my @essentials = $fig->get_attributes($fid, undef, ['essential', 'potential-essential']);
219          for my $essentialTuple (@essentials) {          for my $essentialTuple (@essentials) {
220              my (undef, undef, $essentialityType, $url) = @$essentialTuple;              my (undef, undef, $essentialityType, $url) = @$essentialTuple;
221                # Only keep this datum if it has a URL. The ones without URLs are
222                # all duplicates.
223                if ($url) {
224              # Form a hyperlink from this essentiality tuple.              # Form a hyperlink from this essentiality tuple.
225              my $link = HyperLink->new($essentialityType, $url);              my $link = HyperLink->new($essentialityType, $url);
226              # Store it as essentiality data for this feature.              # Store it as essentiality data for this feature.
227              $self->PutE(FeatureEssential => $fid, essential => $link);              $self->PutE(FeatureEssential => $fid, essential => $link);
228          }          }
229            }
230          # If this is a PEG, we have a protein sequence.          # If this is a PEG, we have a protein sequence.
231          my $proteinID;          my $proteinID;
232          if ($type eq 'peg') {          if ($type eq 'peg') {
233              # Get the translation.              # Get the translation.
234              my $proteinSequence = $fig->get_translation($fid);              my $proteinSequence = $fig->get_translation($fid);
235                if (! $proteinSequence) {
236                    Trace("No protein sequence found for $fid.") if T(2);
237                    $self->Add(missingProtein => 1);
238                    # Here there was some sort of error and the protein sequence did
239                    # not come back. Ask for the DNA and translate it instead.
240                    my $dna = $fig->get_dna_seq($fid);
241                    $proteinSequence = FIG::translate($dna, undef, 1);
242                }
243              # Compute the ID.              # Compute the ID.
244              $proteinID = ERDB::DigestKey($proteinSequence);              $proteinID = ERDB::DigestKey($proteinSequence);
245              # Create the protein record.              # Create the protein record.
# Line 257  Line 273 
273              my $natural = AliasAnalysis::Type($aliasType => $aliasID) || $aliasID;              my $natural = AliasAnalysis::Type($aliasType => $aliasID) || $aliasID;
274              # Create the identifier record.              # Create the identifier record.
275              $self->PutE(Identifier => $aliasID, natural_form => $natural,              $self->PutE(Identifier => $aliasID, natural_form => $natural,
276                          source => $type);                          source => $aliasType);
277              # Is this a protein alias?              # Is this a protein alias?
278              if ($aliasConf eq 'C' && $proteinID) {              if ($aliasConf eq 'C' && $proteinID) {
279                  # Yes. Connect it using IsNamedBy.                  # Yes. Connect it using IsNamedBy.
# Line 271  Line 287 
287          $self->PutE(Identifier => $fid, natural_form => $fid,          $self->PutE(Identifier => $fid, natural_form => $fid,
288                      source => 'SEED');                      source => 'SEED');
289          $self->PutR(Identifies => $fid, $fid, conf => 'A');          $self->PutR(Identifies => $fid, $fid, conf => 'A');
         if ($proteinID) {  
             $self->PutR(IsNamedBy => $proteinID, $fid);  
         }  
290      }      }
291  }  }
292    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3