[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.6, Thu Oct 29 18:31:48 2009 UTC revision 1.8, Wed Dec 16 01:45:19 2009 UTC
# Line 27  Line 27 
27      use HyperLink;      use HyperLink;
28      use AliasAnalysis;      use AliasAnalysis;
29      use LoaderUtils;      use LoaderUtils;
30        use Digest::MD5;
31      use base 'BaseSaplingLoader';      use base 'BaseSaplingLoader';
32    
33  =head1 Sapling Feature Load Group Class  =head1 Sapling Feature Load Group Class
# Line 138  Line 139 
139          my ($fid, $locationString, $aliases, $type, undef, undef, $assignment,          my ($fid, $locationString, $aliases, $type, undef, undef, $assignment,
140              $assignmentMaker, $quality) = @$feature;              $assignmentMaker, $quality) = @$feature;
141          $self->Track(Features => $fid, 1000);          $self->Track(Features => $fid, 1000);
142          # Fix the assignment for non-PEG features.          # Fix missing assignments. For RNAs, the assignment may be in the alias list.
143          if (! defined $assignment) {          if (! defined $assignment) {
144                if ($type eq 'rna') {
145              $assignment = $aliases;              $assignment = $aliases;
146              $assignmentMaker ||= 'master';              $assignmentMaker ||= 'master';
147                } else {
148                    $assignment = '';
149                }
150          }          }
151          # Convert the location string to a list of location objects.          # Convert the location string to a list of location objects.
152          my @locs = map { BasicLocation->new($_) } split /\s*,\s*/, $locationString;          my @locs = map { BasicLocation->new($_) } split /\s*,\s*/, $locationString;
# Line 228  Line 233 
233          if ($type eq 'peg') {          if ($type eq 'peg') {
234              # Get the translation.              # Get the translation.
235              my $proteinSequence = $fig->get_translation($fid);              my $proteinSequence = $fig->get_translation($fid);
236                if (! $proteinSequence) {
237                    Trace("No protein sequence found for $fid.") if T(2);
238                    $self->Add(missingProtein => 1);
239                    # Here there was some sort of error and the protein sequence did
240                    # not come back. Ask for the DNA and translate it instead.
241                    my $dna = $fig->get_dna_seq($fid);
242                    $proteinSequence = FIG::translate($dna, undef, 1);
243                }
244              # Compute the ID.              # Compute the ID.
245              $proteinID = ERDB::DigestKey($proteinSequence);              $proteinID = $sapling->ProteinID($proteinSequence);
246              # Create the protein record.              # Create the protein record.
247              $self->PutE(ProteinSequence => $proteinID, sequence => $proteinSequence);              $self->PutE(ProteinSequence => $proteinID, sequence => $proteinSequence);
248              $self->PutR(IsProteinFor => $proteinID, $fid);              $self->PutR(IsProteinFor => $proteinID, $fid);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3