[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.62, Sun Jul 30 05:44:57 2006 UTC revision 1.67, Tue Sep 19 00:11:12 2006 UTC
# Line 120  Line 120 
120                      # an omitted access code can be defaulted to 1.                      # an omitted access code can be defaulted to 1.
121                      for my $genomeLine (@genomeList) {                      for my $genomeLine (@genomeList) {
122                          my ($genomeID, $accessCode) = split("\t", $genomeLine);                          my ($genomeID, $accessCode) = split("\t", $genomeLine);
123                          if (undef $accessCode) {                          if (! defined($accessCode)) {
124                              $accessCode = 1;                              $accessCode = 1;
125                          }                          }
126                          $genomes{$genomeID} = $accessCode;                          $genomes{$genomeID} = $accessCode;
# Line 505  Line 505 
505                      $oldFeatureID = $featureID;                      $oldFeatureID = $featureID;
506                      # Count this feature.                      # Count this feature.
507                      $loadFeature->Add("featureIn");                      $loadFeature->Add("featureIn");
508                        # Get the functional assignment.
509                        my $assignment = $fig->function_of($featureID);
510                      # Create the feature record.                      # Create the feature record.
511                      $loadFeature->Put($featureID, 1, $type);                      $loadFeature->Put($featureID, 1, $type, $assignment);
512                      # Link it to the parent genome.                      # Link it to the parent genome.
513                      $loadHasFeature->Put($genomeID, $featureID, $type);                      $loadHasFeature->Put($genomeID, $featureID, $type);
514                      # Create the aliases.                      # Create the aliases.
# Line 609  Line 611 
611              Trace("Processing features for genome $genomeID.") if T(3);              Trace("Processing features for genome $genomeID.") if T(3);
612              # Get the feature list for this genome.              # Get the feature list for this genome.
613              my $features = $fig->all_features_detailed($genomeID);              my $features = $fig->all_features_detailed($genomeID);
614                # Count the BBHs we find.
615                my $bbhCount = 0;
616              # Loop through the features.              # Loop through the features.
617              for my $featureData (@{$features}) {              for my $featureData (@{$features}) {
618                  # Split the tuple.                  # Split the tuple.
# Line 624  Line 628 
628                      if ($genomeHash->{$targetGenomeID}) {                      if ($genomeHash->{$targetGenomeID}) {
629                          $loadIsBidirectionalBestHitOf->Put($featureID, $targetID, $targetGenomeID,                          $loadIsBidirectionalBestHitOf->Put($featureID, $targetID, $targetGenomeID,
630                                                             $score);                                                             $score);
631                            $bbhCount++;
632                      }                      }
633                  }                  }
634              }              }
635                Trace("$bbhCount BBHs found for $genomeID.") if T(3);
636          }          }
637      }      }
638      # Finish the loads.      # Finish the loads.
# Line 738  Line 744 
744                  my $curator = $sub->get_curator();                  my $curator = $sub->get_curator();
745                  my $notes = $sub->get_notes();                  my $notes = $sub->get_notes();
746                  $loadSubsystem->Put($subsysID, $curator, $notes);                  $loadSubsystem->Put($subsysID, $curator, $notes);
747                  my $class = $fig->subsystem_classification($subsysID);                  my $classList = $fig->subsystem_classification($subsysID);
748                  if ($class) {                  my @classes = @$classList;
749                    if (@classes) {
750                        for my $class (@classes) {
751                      $loadSubsystemClass->Put($subsysID, $class);                      $loadSubsystemClass->Put($subsysID, $class);
752                  }                  }
753                    }
754                  # Connect it to its roles. Each role is a column in the subsystem spreadsheet.                  # Connect it to its roles. Each role is a column in the subsystem spreadsheet.
755                  for (my $col = 0; defined($roleID = $sub->get_role($col)); $col++) {                  for (my $col = 0; defined($roleID = $sub->get_role($col)); $col++) {
756                      # Connect to this role.                      # Connect to this role.
# Line 944  Line 953 
953          my %propertyKeys = ();          my %propertyKeys = ();
954          my $nextID = 1;          my $nextID = 1;
955          # Loop through the genomes.          # Loop through the genomes.
956          for my $genomeID (keys %{$genomeHash}) {          for my $genomeID (sort keys %{$genomeHash}) {
957              $loadProperty->Add("genomeIn");              $loadProperty->Add("genomeIn");
958              Trace("Generating properties for $genomeID.") if T(3);              Trace("Generating properties for $genomeID.") if T(3);
959              # Get the genome's features. The feature ID is the first field in the              # Get the genome's features. The feature ID is the first field in the
# Line 1398  Line 1407 
1407          Trace("Generating group data.") if T(2);          Trace("Generating group data.") if T(2);
1408          # Loop through the genomes.          # Loop through the genomes.
1409          my $line;          my $line;
1410          for my $genomeID (keys %{$genomeHash}) {          for my $genomeID (sort keys %{$genomeHash}) {
1411              Trace("Processing $genomeID.") if T(3);              Trace("Processing $genomeID.") if T(3);
1412              # Open the NMPDR group file for this genome.              # Open the NMPDR group file for this genome.
1413              if (open(TMP, "<$FIG_Config::organisms/$genomeID/NMPDR") &&              if (open(TMP, "<$FIG_Config::organisms/$genomeID/NMPDR") &&
# Line 1506  Line 1515 
1515  The following relations are loaded by this method.  The following relations are loaded by this method.
1516    
1517      Family      Family
1518      ContainsFeature      IsFamilyForFeature
1519    
1520  The source information for these relations is taken from the C<families_for_protein>,  The source information for these relations is taken from the C<families_for_protein>,
1521  C<family_function>, and C<sz_family> methods of the B<FIG> object.  C<family_function>, and C<sz_family> methods of the B<FIG> object.
# Line 1530  Line 1539 
1539      my $genomeHash = $self->{genomes};      my $genomeHash = $self->{genomes};
1540      # Create load objects for the tables we're loading.      # Create load objects for the tables we're loading.
1541      my $loadFamily = $self->_TableLoader('Family');      my $loadFamily = $self->_TableLoader('Family');
1542      my $loadContainsFeature = $self->_TableLoader('ContainsFeature');      my $loadIsFamilyForFeature = $self->_TableLoader('IsFamilyForFeature');
1543      if ($self->{options}->{loadOnly}) {      if ($self->{options}->{loadOnly}) {
1544          Trace("Loading from existing files.") if T(2);          Trace("Loading from existing files.") if T(2);
1545      } else {      } else {
# Line 1542  Line 1551 
1551              Trace("Processing features for $genomeID.") if T(2);              Trace("Processing features for $genomeID.") if T(2);
1552              # Loop through this genome's PEGs.              # Loop through this genome's PEGs.
1553              for my $fid ($fig->all_features($genomeID, "peg")) {              for my $fid ($fig->all_features($genomeID, "peg")) {
1554                  $loadContainsFeature->Add("features", 1);                  $loadIsFamilyForFeature->Add("features", 1);
1555                  # Get this feature's families.                  # Get this feature's families.
1556                  my @families = $fig->families_for_protein($fid);                  my @families = $fig->families_for_protein($fid);
1557                  # Loop through the families, connecting them to the feature.                  # Loop through the families, connecting them to the feature.
1558                  for my $family (@families) {                  for my $family (@families) {
1559                      $loadContainsFeature->Put($family, $fid);                      $loadIsFamilyForFeature->Put($family, $fid);
1560                      # If this is a new family, create a record for it.                      # If this is a new family, create a record for it.
1561                      if (! exists $familyHash{$family}) {                      if (! exists $familyHash{$family}) {
1562                          $familyHash{$family} = 1;                          $familyHash{$family} = 1;

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.67

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3