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

Diff of /Sprout/SproutLoad.pm

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

revision 1.8, Wed Sep 14 09:57:27 2005 UTC revision 1.13, Fri Sep 16 02:15:02 2005 UTC
# Line 434  Line 434 
434      # Create load objects for each of the tables we're loading.      # Create load objects for each of the tables we're loading.
435      my $loadFeature = $self->_TableLoader('Feature', $featureCount);      my $loadFeature = $self->_TableLoader('Feature', $featureCount);
436      my $loadIsLocatedIn = $self->_TableLoader('IsLocatedIn', $featureCount);      my $loadIsLocatedIn = $self->_TableLoader('IsLocatedIn', $featureCount);
437      my ($loadFeatureAlias, $loadFeatureLink, $loadFeatureTranslation, $loadFeatureUpstream);      my $loadFeatureAlias = $self->_TableLoader('FeatureAlias', $featureCount * 6);
438        my ($loadFeatureLink, $loadFeatureTranslation, $loadFeatureUpstream);
439      if (! $limited) {      if (! $limited) {
         $loadFeatureAlias = $self->_TableLoader('FeatureAlias', $featureCount * 6);  
440          $loadFeatureLink = $self->_TableLoader('FeatureLink', $featureCount * 10);          $loadFeatureLink = $self->_TableLoader('FeatureLink', $featureCount * 10);
441          $loadFeatureTranslation = $self->_TableLoader('FeatureTranslation', $featureCount);          $loadFeatureTranslation = $self->_TableLoader('FeatureTranslation', $featureCount);
442          $loadFeatureUpstream = $self->_TableLoader('FeatureUpstream', $featureCount);          $loadFeatureUpstream = $self->_TableLoader('FeatureUpstream', $featureCount);
# Line 455  Line 455 
455          for my $featureData (@{$features}) {          for my $featureData (@{$features}) {
456              $loadFeature->Add("featureIn");              $loadFeature->Add("featureIn");
457              # Split the tuple.              # Split the tuple.
458              my ($featureID, $locations, $aliases, $type) = @{$featureData};              my ($featureID, $locations, undef, $type) = @{$featureData};
459              # Create the feature record.              # Create the feature record.
460              $loadFeature->Put($featureID, 1, $type);              $loadFeature->Put($featureID, 1, $type);
             # The next stuff is for a full load only.  
             if (! $limited) {  
461                  # Create the aliases.                  # Create the aliases.
462                  for my $alias (split /\s*,\s*/, $aliases) {              for my $alias ($fig->feature_aliases($featureID)) {
463                      $loadFeatureAlias->Put($featureID, $alias);                      $loadFeatureAlias->Put($featureID, $alias);
464                  }                  }
465                # The next stuff is for a full load only.
466                if (! $limited) {
467                  # Get the links.                  # Get the links.
468                  my @links = $fig->fid_links($featureID);                  my @links = $fig->fid_links($featureID);
469                  for my $link (@links) {                  for my $link (@links) {
# Line 493  Line 493 
493              # Loop through the locations.              # Loop through the locations.
494              for my $location (@locationList) {              for my $location (@locationList) {
495                  # Parse the location.                  # Parse the location.
496                  my $locObject = BasicLocation->new($location);                  my $locObject = BasicLocation->new("$genomeID:$location");
497                  # Split it into a list of chunks.                  # Split it into a list of chunks.
498                  my @locOList = ();                  my @locOList = ();
499                  while (my $peeling = $locObject->Peel($chunkSize)) {                  while (my $peeling = $locObject->Peel($chunkSize)) {
# Line 673  Line 673 
673          # get the genomes on the sheet.          # get the genomes on the sheet.
674          Trace("Creating subsystem $subsysID spreadsheet.") if T(3);          Trace("Creating subsystem $subsysID spreadsheet.") if T(3);
675          my @genomes = map { $_->[0] } @{$fig->subsystem_genomes($subsysID)};          my @genomes = map { $_->[0] } @{$fig->subsystem_genomes($subsysID)};
676          for my $genomeID (@genomes) {          for my $genomeID (sort @genomes) {
677              # Only process this genome if it's one of ours.              # Only process this genome if it's one of ours.
678              if (exists $genomeHash->{$genomeID}) {              if (exists $genomeHash->{$genomeID}) {
679                    Trace("Processing genome $genomeID for subsystem $subsysID.");
680                  # Connect the genome to the subsystem.                  # Connect the genome to the subsystem.
681                  $loadParticipatesIn->Put($genomeID, $subsysID);                  $loadParticipatesIn->Put($genomeID, $subsysID);
682                    # Count the PEGs and cells found for verification purposes.
683                    my $pegCount = 0;
684                    my $cellCount = 0;
685                  # Loop through the subsystem's roles. We use an index because it is                  # Loop through the subsystem's roles. We use an index because it is
686                  # part of the spreadsheet cell ID.                  # part of the spreadsheet cell ID.
687                  for (my $i = 0; $i <= $#roles; $i++) {                  for (my $i = 0; $i <= $#roles; $i++) {
# Line 687  Line 691 
691                      # Only proceed if features exist.                      # Only proceed if features exist.
692                      if (@pegs > 0) {                      if (@pegs > 0) {
693                          # Create the spreadsheet cell.                          # Create the spreadsheet cell.
694                            $cellCount++;
695                          my $cellID = "$subsysID:$genomeID:$i";                          my $cellID = "$subsysID:$genomeID:$i";
696                          $loadSSCell->Put($cellID);                          $loadSSCell->Put($cellID);
697                          $loadIsGenomeOf->Put($genomeID, $cellID);                          $loadIsGenomeOf->Put($genomeID, $cellID);
# Line 695  Line 700 
700                          # Attach the features to it.                          # Attach the features to it.
701                          for my $pegID (@pegs) {                          for my $pegID (@pegs) {
702                              $loadContainsFeature->Put($cellID, $pegID);                              $loadContainsFeature->Put($cellID, $pegID);
703                                $pegCount++;
704                          }                          }
705                      }                      }
706                  }                  }
707                    Trace("$pegCount PEGs found in $cellCount cells.") if T(3);
708              }              }
709          }          }
710      }      }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3