various edits
This commit is contained in:
parent
90b9477520
commit
8d8a61675f
3 changed files with 601 additions and 1 deletions
41
scripts/ml/ml_functions/SANITY_CHECK_mask.py
Normal file
41
scripts/ml/ml_functions/SANITY_CHECK_mask.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Wed Jul 27 12:17:35 2022
|
||||
|
||||
@author: tanu
|
||||
"""
|
||||
foo = df[['ligand_distance', 'interface_dist', 'ligand_affinity_change','mcsm_ppi2_affinity']]
|
||||
cols_to_mask = ['ligand_affinity_change']
|
||||
cols_to_mask_ppi2 = ['mcsm_ppi2_affinity']
|
||||
(foo[cols_to_mask+cols_to_mask_ppi2] == 0).sum()
|
||||
(foo[cols_to_mask+cols_to_mask_ppi2] > 0).sum()
|
||||
foo.loc[(my_df_ml['ligand_distance'] > 10), cols_to_mask] = 0
|
||||
|
||||
|
||||
infile_ml1 = '/home/tanu/git/Data/ethambutol/output/embb_merged_df3.csv'
|
||||
bar = pd.read_csv(infile_ml1, index_col = 0)
|
||||
bar = bar[['ligand_distance', 'interface_dist', 'ligand_affinity_change','mcsm_ppi2_affinity']]
|
||||
#(bar[cols_to_mask+cols_to_mask_ppi2] == 0).sum()
|
||||
bar2 = bar.copy()
|
||||
|
||||
bar2.loc[(bar2['ligand_distance'] >10), cols_to_mask].value_counts()
|
||||
bar2.loc[(bar2['ligand_affinity_change'] == 0)].value_counts()
|
||||
# now change
|
||||
bar2.loc[(bar2['ligand_distance'] > 10), cols_to_mask] = 0
|
||||
bar2.loc[(bar2['ligand_affinity_change'] == 0)].value_counts()
|
||||
|
||||
|
||||
bar2.loc[(bar2['ligand_distance'] == 0), cols_to_mask].value_counts()
|
||||
|
||||
bar2.loc[(bar2['ligand_distance'] > 10), cols_to_mask].value_counts()
|
||||
(bar2[cols_to_mask] == 0).sum()
|
||||
|
||||
|
||||
bar2.loc[(bar2['interface_dist'] > 10), cols_to_mask_ppi2] = 0
|
||||
bar2.loc[(bar2['interface_dist'] > 10), cols_to_mask_ppi2].value_counts()
|
||||
bar2.loc[(bar2['interface_dist'] == 0), cols_to_mask_ppi2].value_counts()
|
||||
(bar2[cols_to_mask_ppi2] == 0).sum()
|
||||
|
||||
|
||||
['interface_dist'] + cols_to_mask_ppi2
|
Loading…
Add table
Add a link
Reference in a new issue