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

Diff of /Sprout/GenomeSaplingLoader.pm

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

revision 1.7, Wed Nov 25 22:01:03 2009 UTC revision 1.9, Thu Mar 25 16:20:40 2010 UTC
# Line 308  Line 308 
308      my $sapling = $self->db();      my $sapling = $self->db();
309      # Get the source object.      # Get the source object.
310      my $fig = $sapling->GetSourceObject();      my $fig = $sapling->GetSourceObject();
311        # Get the DNA chunk size.
312        my $segmentLength = $sapling->TuningParameter('maxSequenceLength');
313        Trace("DNA chunk size is $segmentLength.") if T(ERDBLoadGroup => 3);
314      # We start with the genome record itself, asking the FIG object      # We start with the genome record itself, asking the FIG object
315      # for its various properties.      # for its various properties.
316      my $scientific_name = $fig->genus_species($genomeID);      my $scientific_name = $fig->genus_species($genomeID);
# Line 320  Line 323 
323      # We need to compute the number of contigs from the list of contig IDs.      # We need to compute the number of contigs from the list of contig IDs.
324      my @contigIDs = $fig->contigs_of($genomeID);      my @contigIDs = $fig->contigs_of($genomeID);
325      my $contigs = scalar(@contigIDs);      my $contigs = scalar(@contigIDs);
326        # Compute the genetic code. Normally, it's 11, but it may be overridden
327        # by a GENETIC_CODE file.
328        my $gcFile = "$FIG_Config::organisms/$genomeID/GENETIC_CODE";
329        my $genetic_code = 11;
330        if (-f $gcFile) {
331            $genetic_code = Tracer::GetFile($gcFile);
332            chomp $genetic_code;
333        }
334      # Write the genome record.      # Write the genome record.
335      $self->PutE(Genome => $genomeID, complete => $complete, contigs => $contigs,      $self->PutE(Genome => $genomeID, complete => $complete, contigs => $contigs,
336                  dna_size => $dna_size, scientific_name => $scientific_name,                  dna_size => $dna_size, scientific_name => $scientific_name,
337                  pegs => $pegs, rnas => $rnas, prokaryotic => $prokaryotic,                  pegs => $pegs, rnas => $rnas, prokaryotic => $prokaryotic,
338                  domain => $domain);                  domain => $domain, genetic_code => $genetic_code);
339      # Now we create the Contigs. Each one needs to be split into DNA sequences.      # Now we create the Contigs. Each one needs to be split into DNA sequences.
340      for my $contigID (@contigIDs) {      for my $contigID (@contigIDs) {
341          $self->Track(Contigs => $contigID, 100);          $self->Track(Contigs => $contigID, 100);
# Line 338  Line 349 
349          # Now we loop through the DNA chunks.          # Now we loop through the DNA chunks.
350          my $loc = 1;          my $loc = 1;
351          my $ordinal = 0;          my $ordinal = 0;
352          my $segmentLength = $sapling->TuningParameter('maxSequenceLength');          while ($loc <= $length) {
         while ($loc < $length) {  
353              # Get this segment's true length.              # Get this segment's true length.
354              my $trueLength = Tracer::Min($length - $loc, $segmentLength);              my $trueLength = Tracer::Min($length + 1 - $loc, $segmentLength);
355              # Compute the index of this segment's last base pair.              # Compute the index of this segment's last base pair.
356              my $endPoint = $loc + $trueLength - 1;              my $endPoint = $loc + $trueLength - 1;
357              # Get the DNA.              # Get the DNA.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3