corrected foldx_outcome classification in combining_dfs.py as positive are Destabilising and neg as Stabilising

This commit is contained in:
Tanushree Tunstall 2021-09-16 10:59:55 +01:00
parent c1d9781cb2
commit 46ebed6b3e

View file

@ -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'