From 46ebed6b3eced2df8ce49186acec8ecd4ab006d7 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Thu, 16 Sep 2021 10:59:55 +0100 Subject: [PATCH] corrected foldx_outcome classification in combining_dfs.py as positive are Destabilising and neg as Stabilising --- scripts/combining_dfs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/combining_dfs.py b/scripts/combining_dfs.py index faa9677..9331edd 100755 --- a/scripts/combining_dfs.py +++ b/scripts/combining_dfs.py @@ -190,6 +190,10 @@ foldx_max = foldx_df['ddg_foldx'].max() foldx_min foldx_max +# quick check +len(foldx_df.loc[foldx_df['ddg_foldx'] >= 0]) +len(foldx_df.loc[foldx_df['ddg_foldx'] < 0]) + foldx_scale = lambda x : x/abs(foldx_min) if x < 0 else (x/foldx_max if x >= 0 else 'failed') foldx_df['foldx_scaled'] = foldx_df['ddg_foldx'].apply(foldx_scale) @@ -216,13 +220,16 @@ else: , '\n======================================================') #------------------------- -# foldx outcome category +# foldx outcome category: +# Remember, its inverse +# +ve: Destabilising +# -ve: Stabilising #-------------------------- -foldx_df['foldx_outcome'] = foldx_df['ddg_foldx'].apply(lambda x: 'Stabilising' if x >= 0 else 'Destabilising') +foldx_df['foldx_outcome'] = foldx_df['ddg_foldx'].apply(lambda x: 'Destabilising' if x >= 0 else 'Stabilising') foldx_df[foldx_df['ddg_foldx']>=0].count() foc = foldx_df['foldx_outcome'].value_counts() -if foc['Stabilising'] == foldx_pos and foc['Stabilising'] == foldx_pos2: +if foc['Destabilising'] == foldx_pos and foc['Destabilising'] == foldx_pos2: print('\nPASS: Foldx outcome category created') else: print('\nFAIL: Foldx outcome category could NOT be created'