[Bio] / Sprout / AttrDBRefresh.pl Repository:
ViewVC logotype

Diff of /Sprout/AttrDBRefresh.pl

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

revision 1.14, Fri Apr 27 22:17:06 2007 UTC revision 1.15, Wed May 2 05:53:17 2007 UTC
# Line 114  Line 114 
114    
115      -mapSubkey=docking_results/^ZINC//      -mapSubkey=docking_results/^ZINC//
116    
117    =item dockClean
118    
119    If specified, Predicted docking results will be removed from the attribute database.
120    
121  =back  =back
122    
123  =cut  =cut
# Line 148  Line 152 
152                                                appendLoad => ["", "if specified, no data will be erased before loading from the load file"],                                                appendLoad => ["", "if specified, no data will be erased before loading from the load file"],
153                                                showKeyDef => ["", "if specified, the name of a key whose descriptive data is to be displayed"],                                                showKeyDef => ["", "if specified, the name of a key whose descriptive data is to be displayed"],
154                                                mapSubkey => ["", "instructions for fixing subkey values"],                                                mapSubkey => ["", "instructions for fixing subkey values"],
155                                                  dockClean => ["", "if specified, Predicted docking results will be removed from the database"],
156                                             },                                             },
157                                             "",                                             "",
158                                             @ARGV);                                             @ARGV);
# Line 427  Line 432 
432              Confess("Invalid substitution syntax in mapSubkey option.");              Confess("Invalid substitution syntax in mapSubkey option.");
433          }          }
434      }      }
435        if ($options->{dockClean}) {
436            # Get the list of PDBs with results.
437            my @pdbList = sort map { $_->[0] } $ca->GetAttributes(undef, 'has_results');
438            # Loop through the PDB IDs.
439            for my $pdbID (@pdbList) {
440                Trace("Processing $pdbID.") if T(3);
441                # Loop until we run out of rows to delete.
442                my $thisCount = 1;
443                my $totalCount = 0;
444                while ($thisCount) {
445                    # Delete a bunch of rows. To avoid a timeout, we limit the results.
446                    $thisCount = $ca->DeleteLike('HasValueFor', 'HasValueFor(from-link) = ? AND HasValueFor(value) LIKE ? LIMIT 10000',
447                                               [$pdbID, '%Predicted']);
448                    $totalCount += $thisCount;
449                    Trace("$thisCount rows deleted in batch. $totalCount total deletions for pdb $pdbID.") if T(3);
450                }
451            }
452        }
453      Trace("Processing complete.") if T(2);      Trace("Processing complete.") if T(2);
454  };  };
455  if ($@) {  if ($@) {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3