From 11f3157dd640d33c33050888882902b28c2ed33c Mon Sep 17 00:00:00 2001 From: MaohuaYang Date: Thu, 15 Sep 2022 17:25:01 +0800 Subject: [PATCH] fix: parse result bug --- hmtpbsa/pbsa/pbsarun.py | 2 +- hmtpbsa/pipeline.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hmtpbsa/pbsa/pbsarun.py b/hmtpbsa/pbsa/pbsarun.py index 9be6d53..d5cb72d 100644 --- a/hmtpbsa/pbsa/pbsarun.py +++ b/hmtpbsa/pbsa/pbsarun.py @@ -173,5 +173,5 @@ def save_results(self, energyfile='Energy.csv', decfile='Dec.csv', mmxsafile=Non return deltaG, resG = parse_GMXMMPBSA_RESULTS(mmxsafile=mmxsafile) deltaG.to_csv(energyfile) - if resG: + if resG is not None: resG.to_csv(decfile) \ No newline at end of file diff --git a/hmtpbsa/pipeline.py b/hmtpbsa/pipeline.py index 564d518..4d25d56 100644 --- a/hmtpbsa/pipeline.py +++ b/hmtpbsa/pipeline.py @@ -97,8 +97,8 @@ def base_pipeline(receptorfile, ligandfiles, paras, nt=1, mmpbsafile=None, outfi statu = 'F_GBSA' dl = d logging.warning('Failed to run GBSA for ligand: %s'%ligandName) - ligandnames.append(ligandName) - status.append(statu) + ligandnames.extend([ligandName]*len(dl)) + status.extend([statu]*len(dl)) if df is None: df = dl else: @@ -179,8 +179,8 @@ def minim_pipeline(receptorfile, ligandfiles, paras, mmpbsafile=None, nt=1, outf statu = 'F_GBSA' dl = d logging.warning('Failed to run GBSA for ligand: %s'%ligandName) - ligandnames.append(ligandName) - status.append(statu) + ligandnames.extend([ligandName]*len(dl)) + status.extend([statu]*len(dl)) if df is None: df = dl else: