[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.18, Wed May 8 20:28:44 2013 UTC revision 1.19, Thu Jul 11 19:34:38 2013 UTC
# Line 817  Line 817 
817      # Compute the subsystem and binding file names.      # Compute the subsystem and binding file names.
818      my $subFileName = "$self->{directory}/Subsystems/subsystems";      my $subFileName = "$self->{directory}/Subsystems/subsystems";
819      my $bindFileName = "$self->{directory}/Subsystems/bindings";      my $bindFileName = "$self->{directory}/Subsystems/bindings";
820        # Get a hash of the molecular machines already connected to this genome.
821        my %machinesOld = map { $_ => 1 } $sap->GetFlat('Uses', 'Uses(from-link) = ?',
822                [$genome], 'to-link');
823      # Only proceed if both exist.      # Only proceed if both exist.
824      if (! -f $subFileName || ! -f $bindFileName) {      if (! -f $subFileName || ! -f $bindFileName) {
825          Trace("Missing subsystem data for $genome.") if T(1);          Trace("Missing subsystem data for $genome.") if T(1);
# Line 863  Line 866 
866                  # Now we create the molecular machine connecting this genome to the                  # Now we create the molecular machine connecting this genome to the
867                  # subsystem variant.                  # subsystem variant.
868                  my $machineID = ERDB::DigestKey("$subsystem:$variantCode:$genome");                  my $machineID = ERDB::DigestKey("$subsystem:$variantCode:$genome");
869                    # Does it already exist?
870                    if ($machinesOld{$machineID}) {
871                        # Yes. Output a warning.
872                        Trace("Machine $machineID already found for $subsystem and genome $genome.") if T(1);
873                        $stats->Add(duplicateMachine => 1);
874                    } else {
875                  $sap->InsertObject('Uses', from_link => $genome, to_link => $machineID);                  $sap->InsertObject('Uses', from_link => $genome, to_link => $machineID);
876                  $sap->InsertObject('MolecularMachine', id => $machineID, curated => 0, region => '');                  $sap->InsertObject('MolecularMachine', id => $machineID, curated => 0, region => '');
877                  $sap->InsertObject('IsImplementedBy', from_link => $variantKey, to_link => $machineID);                  $sap->InsertObject('IsImplementedBy', from_link => $variantKey, to_link => $machineID);
878                    }
879                  # Remember the machine ID.                  # Remember the machine ID.
880                  $machines{$subsystem} = $machineID;                  $machines{$subsystem} = $machineID;
881              }              }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3