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

Diff of /Sprout/SaplingGenomeLoader.pm

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

revision 1.9, Thu Apr 21 19:58:18 2011 UTC revision 1.10, Sat Apr 23 20:19:24 2011 UTC
# Line 809  Line 809 
809      while (! eof $ih) {      while (! eof $ih) {
810          # Get this subsystem.          # Get this subsystem.
811          my ($subsystem, $variant) = Tracer::GetLine($ih);          my ($subsystem, $variant) = Tracer::GetLine($ih);
812            Trace("Processing subsystem $subsystem variant $variant.") if T(3);
813          # Normalize the subsystem name.          # Normalize the subsystem name.
814          $subsystem = $sap->SubsystemID($subsystem);          $subsystem = $sap->SubsystemID($subsystem);
815          # Compute this subsystem's MD5.          # Compute this subsystem's MD5.
# Line 827  Line 828 
828                  my $roleH = $roleList->[0];                  my $roleH = $roleList->[0];
829                  my %subFields = SaplingDataLoader::ExtractFields(Subsystem => $roleH);                  my %subFields = SaplingDataLoader::ExtractFields(Subsystem => $roleH);
830                  $sap->InsertObject('Subsystem', %subFields);                  $sap->InsertObject('Subsystem', %subFields);
831                    $stats->Add(subsystems => 1);
832                  # Now loop through the roles. The Includes records are always inserted, but the                  # Now loop through the roles. The Includes records are always inserted, but the
833                  # roles are only inserted if they don't already exist.                  # roles are only inserted if they don't already exist.
834                  for $roleH (@$roleList) {                  for $roleH (@$roleList) {
# Line 841  Line 843 
843                      # Compute the machine-role ID.                      # Compute the machine-role ID.
844                      my $machineRoleID = join(":", $subsystemMD5, $genome, $incFields{abbreviation});                      my $machineRoleID = join(":", $subsystemMD5, $genome, $incFields{abbreviation});
845                      $machineRoles{$subsystem}{$roleID} = $machineRoleID;                      $machineRoles{$subsystem}{$roleID} = $machineRoleID;
846                        $stats->Add(subsystemRoles => 1);
847                  }                  }
848              }              }
849          } else {          } else {
# Line 862  Line 865 
865          $variantCode =~ s/\*+$//;          $variantCode =~ s/\*+$//;
866          # Compute the variant key.          # Compute the variant key.
867          my $variantKey = ERDB::DigestKey("$subsystem:$variantCode");          my $variantKey = ERDB::DigestKey("$subsystem:$variantCode");
868            # Insure we have it in the database.
869            if (! $sap->Exists(Variant => $variantKey)) {
870          # Get the variant from the sapling server.          # Get the variant from the sapling server.
871          my $variantH = $sapO->get(-objects => "Variant",          my $variantH = $sapO->get(-objects => "Variant",
872                                    -filter => {"Variant(id)" => ["=", $variantKey]},                                    -filter => {"Variant(id)" => ["=", $variantKey]},
# Line 870  Line 875 
875                                                "Variant(type)" => "type",                                                "Variant(type)" => "type",
876                                                "Variant(role-rule)" => "role-rule"},                                                "Variant(role-rule)" => "role-rule"},
877                                    -firstOnly => 1);                                    -firstOnly => 1);
         # Insure we have it in the database.  
878          $self->InsureEntity('Variant', $variantKey, %$variantH);          $self->InsureEntity('Variant', $variantKey, %$variantH);
         $stats->Add(subsystems => 1);  
879          # Connect it to the subsystem.          # Connect it to the subsystem.
880          $sap->InsertObject('Describes', from_link => $subsystem, to_link => $variantKey);          $sap->InsertObject('Describes', from_link => $subsystem, to_link => $variantKey);
881                $stats->Add(subsystemVariants => 1);
882            }
883          # Now we create the molecular machine connecting this genome to the subsystem          # Now we create the molecular machine connecting this genome to the subsystem
884          # variant.          # variant.
885          my $machineID = ERDB::DigestKey("$subsystem:$variantCode:$genome");          my $machineID = ERDB::DigestKey("$subsystem:$variantCode:$genome");

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3