Open SnehaBheemireddy1 opened 1 month ago
Also, key error 156.
KeyError Traceback (most recent call last) Cell In[1], line 32 22 cmd.hide('lines', '*') 24 cmd.set_view((\ 25 0.264859468, -0.952457845, -0.150496021,\ 26 -0.843045175, -0.304483652, 0.443325162,\ (...) 29 8.123708725, 6.384021759, 22.244569778,\ 30 105.477645874, 162.093704224, -20.000000000)) ---> 32 draw_network_from_df(path +'network_Ptpa_Q75L_filter_d_0_5.pkl', which='gcc_Q75L', color_by='gcc_Q75L', sns_palette=sns.color_palette("tab20"), label='gcc_Q75L', edge_norm=1) 33 draw_network_from_df(path + 'network_Ptpa_WT_filter_d_0_5.pkl', which='gcc_WT', color_by='gcc_WT', sns_palette=sns.color_palette("tab20"), label='gcc_WT', edge_norm=1) 34 draw_network_from_df(path +'network_Ptpa_Q75L_filter_d_0_5.pkl', which='dgcc_Q75L', color_by='dgcc_Q75L', sns_palette=sns.color_palette("tab20"), label='dgcc_Q75L', edge_norm=1)
File ~/work/mdigest/draw_network_pymol.py:30, in draw_network_from_df(path_to_df, reset_view, hide_nodes, kwargs) 28 view = cmd.get_view() 29 df = load_df(path_to_df) ---> 30 draw_network(df, kwargs) 31 if reset_view: 32 cmd.set_view(view)
File ~/work/mdigest/draw_network_pymol.py:353, in draw_network(df, key, selection, which, w1, w2, reset_view, default_color, check_nodeIDs, center, label, color_sign, color_by, sns_palette, edge_norm, flattenweight, group_by, r) 350 print("we are at 342", color_sign) 351 #print(len(df.columns),df.columns) 352 #print(df) --> 353 _draw_df(df, label=label, flattenweight=flattenweight)
File ~/work/mdigest/draw_network_pymol.py:254, in draw_network.
KeyError: 156
Are you able to resolve this error (KeyError : 156 ) ?
This issue is resolved by using pdb file from given example, don't use pdb from PDB database. the residue index is not same in both cases. causing this error.
I see,
thanks I’, goint to fix this asap.
Federica
On Nov 25, 2024, at 12:10 PM, vas penu @.***> wrote:
This issue is resolved by using pdb file from given example, don't use pdb from PDB database ?. the residue index is not same in both cases. causing this error.
— Reply to this email directly, view it on GitHub https://github.com/fmaschietto/mdigest/issues/11#issuecomment-2498582602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6HF4OM4QWPHTNCNDRNGYT2CNKZLAVCNFSM6AAAAABP57IPHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJYGU4DENRQGI. You are receiving this because you are subscribed to this thread.
open Pymol locally
from pymol import cmd, util import seaborn as sns import warnings from draw_network_pymol import * warnings.filterwarnings('ignore') cmd.delete('all') cmd.bg_color('black')
place yourself in the
visualize_network
foldercd visualize_network
execute pymol locally calling
pymol
from inside the directory.provide path to pdb and data_frame data_frame: change accordingly
path = 'mdigest-RESULTS/plots/'
cmd.load(path + '1u2p.pdb', '1u2p') cmd.color('grey80', '1u2p') cmd.remove('!(polymer)') cmd.run('draw_network_pymol.py') cmd.hide('lines', '')
cmd.set_view((\ 0.264859468, -0.952457845, -0.150496021,\ -0.843045175, -0.304483652, 0.443325162,\ -0.468080193, 0.009453356, -0.883612871,\ 0.000000000, 0.000000000, -133.785675049,\ 8.123708725, 6.384021759, 22.244569778,\ 105.477645874, 162.093704224, -20.000000000))
draw_network_from_df(path +'network_Ptpa_Q75L_filter_d_0_5.pkl', which='gcc_Q75L', color_by='gcc_Q75L', sns_palette=sns.color_palette("tab20"), label='gcc_Q75L', edge_norm=1) draw_network_from_df(path + 'network_Ptpa_WT_filter_d_0_5.pkl', which='gcc_WT', color_by='gcc_WT', sns_palette=sns.color_palette("tab20"), label='gcc_WT', edge_norm=1) draw_network_from_df(path +'network_Ptpa_Q75L_filter_d_0_5.pkl', which='dgcc_Q75L', color_by='dgcc_Q75L', sns_palette=sns.color_palette("tab20"), label='dgcc_Q75L', edge_norm=1) draw_network_from_df(path + 'network_Ptpa_WT_filter_d_0_5.pkl', which='dgcc_WT', color_by='dgcc_WT', sns_palette=sns.color_palette("tab20"), label='dgcc_WT', edge_norm=1) draw_network_from_df(path +'network_Ptpa_Q75L_filter_d_0_5.pkl', which='ks_gcc_Q75L', color_by='ks_gcc_Q75L', sns_palette=sns.color_palette("tab20"), label='ks_gcc_Q75L', edge_norm=1) draw_network_from_df(path + 'network_Ptpa_WT_filter_d_0_5.pkl', which='ks_gcc_WT', color_by='ks_gcc_WT', sns_palette=sns.color_palette("tab20"), label='ks_gcc_WT', edge_norm=1)