[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.18, Wed Aug 24 17:58:54 2011 UTC revision 1.19, Tue Sep 13 21:07:59 2011 UTC
# Line 206  Line 206 
206      my %seqs = map { $_->[0] => $_->[2] } gjoseqlib::read_fasta("$FIG_Config::organisms/$genomeID/Features/peg/fasta");      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);
     # Compute the MD5 identifiers for the genome and its contigs.  
     my $genomeMD5Data = MD5Computer->new_from_fasta("$FIG_Config::organisms/$genomeID/contigs");  
209      # Loop through them.      # Loop through them.
210      for my $feature (@$featureList) {      for my $feature (@$featureList) {
211          # Get this feature's data.          # Get this feature's data.
# Line 264  Line 262 
262                  $self->Add(badAttachment => 1);                  $self->Add(badAttachment => 1);
263              }              }
264          }          }
         # Compute the MD5 identifier. This may fail if there is an error in the  
         # feature definition.  
         my $md5Alias;  
         eval {  
             $md5Alias = $genomeMD5Data->ComputeFeatureMD5($type, map { $_->String() } @locs);  
         };  
         if ($@) {  
             Trace("Error in $fid MD5 computation: $@") if T(0);  
             $self->Add(md5ComputeError => 1);  
         }  
265          # Emit the feature record.          # Emit the feature record.
266          $self->PutE(Feature => $fid, feature_type => $type,          $self->PutE(Feature => $fid, feature_type => $type,
267                      sequence_length => $seqLen, function => $assignment,                      sequence_length => $seqLen, function => $assignment,
# Line 386  Line 374 
374                  $self->PutR(IsIdentifiedBy => $fid, $aliasID, conf => $aliasConf);                  $self->PutR(IsIdentifiedBy => $fid, $aliasID, conf => $aliasConf);
375              }              }
376          }          }
         # Make the MD5 identifier an alias.  
         if (defined $md5Alias) {  
             $self->PutE(Identifier => "ubi|$md5Alias", natural_form => $md5Alias,  
                         source => 'UBI');  
             $self->PutR(IsIdentifiedBy => $fid, "ubi|$md5Alias", conf => 'A');  
         }  
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');

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3