From 33628203f5bc12225d697f736fc98d0caeac0bec Mon Sep 17 00:00:00 2001 From: Tanmoy Sanyal Date: Fri, 19 Nov 2021 00:45:22 -0800 Subject: [PATCH] prevent un-necessary recalculation of RMSD matrix --- pyext/src/exhaust.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pyext/src/exhaust.py b/pyext/src/exhaust.py index 90edd5c..82d61f5 100644 --- a/pyext/src/exhaust.py +++ b/pyext/src/exhaust.py @@ -218,16 +218,20 @@ def main(): print("Size of conformation matrix", conforms.shape) - if not args.skip_sampling_precision: - # get_rmsds_matrix modifies conforms, so save it to a file and restore - # afterwards (so that we retain the original IMP orientation) - numpy.save("conforms", conforms) + # get_rmsds_matrix modifies conforms, so save it to a file and restore + # afterwards (so that we retain the original IMP orientation) + numpy.save("conforms", conforms) + + if not os.path.isfile("Distances_Matrix.data.npy"): + print("Computing RMSD matrix...") inner_data = rmsd_calculation.get_rmsds_matrix( - conforms, args.mode, args.align, args.cores, symm_groups) + conforms, args.mode, args.align, args.cores, symm_groups) print("Size of RMSD matrix (flattened):", inner_data.shape) del conforms conforms = numpy.load("conforms.npy") os.unlink('conforms.npy') + else: + print("Loading saved RMSD matrix") from pyRMSD.matrixHandler import MatrixHandler mHandler = MatrixHandler()