You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm trying to calculate the interaction between one N atom of my substrate and the H atom from one molecule of solvent near to it for a LAMMPS MD.
As i can see in the trajectory with vmd and from the rdf analysis this atom "moves from the solvent" to the substrate ending doing a covalent bond with the N of the substrate. The same data si confirmed in the rdf showing a peak at 1.10 A and g(r) 100 for this N-H interaction.
Now i'm using this script to analysis the number of this H-bond (as further proof that this interaction occurs in most of the frames)
importnumpyasnpimportMDAnalysisasmdafromMDAnalysis.analysis.hydrogenbondsimportHydrogenBondAnalysisimportpandasaspdimportmatplotlib.pyplotasplt# Carica l’universou=mda.Universe(
'packmol_liquid_generator/output/opt-DFT+packmol/CPX-menth-acetic-70.xyz',
'output/liquid/CPX-menth-acetic-70/lmp.xtc',
guess_bonds=True
)
# Selezioni specifichedonors_sel="bynum 1252"# idrogeno specifico solventehydrogens_sel="bynum 1263"# stesso idrogenoacceptors_sel="bynum 13"# azoto 13 del substrato# Setup analisi H-bondhba=HydrogenBondAnalysis(
universe=u,
donors_sel=donors_sel,
hydrogens_sel=hydrogens_sel,
acceptors_sel=acceptors_sel,
d_a_cutoff=5.0,
d_h_a_angle_cutoff=0.0
)
# Esegui analisihba.run(verbose=True)
# Risultati in array e DataFramehbonds_array=hba.results.hbondshb_df=pd.DataFrame(
hbonds_array,
columns=['frame', 'donor_idx', 'hydrogen_idx', 'acceptor_idx', 'distance', 'angle']
)
print(f"Interazioni H-bond totali tra idrogeno 1263 e azoto 13: {len(hb_df)}")
hbonds_per_frame=hb_df.groupby('frame').size()
indices=hbonds_per_frame.index.astype(int) # conversione esplicita a interiall_frames=np.arange(len(u.trajectory))
counts_full=np.zeros(len(u.trajectory), dtype=int)
counts_full[indices] =hbonds_per_frame.valuesprint(f"Media H-bonds/frame (tutti i frame): {counts_full.mean():.2f}")
and i get only these numbers of H-bonds:
Interazioni H-bond totali tra idrogeno 1263 e azoto 13: 23
Media H-bonds/frame (tutti i frame): 0.11.
There is obviously a mismatch but i'm getting crazy to understand why.
I have already checked the connectivity between the atoms indicated in the indexes and i have tried to change the cutoff also, but nothing,
Thank you very much
# Plotplt.figure(figsize=(8,4))
plt.plot(all_frames, counts_full, color='blue', label='N13 accetta H1263')
plt.xlabel('Frame')
plt.ylabel('Numero di H-bond')
plt.title('H-bond tra idrogeno 1263 (solvente) e azoto 13 (CPX)')
plt.grid(True)
plt.legend()
plt.tight_layout()
plt.show()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
i'm trying to calculate the interaction between one N atom of my substrate and the H atom from one molecule of solvent near to it for a LAMMPS MD.
As i can see in the trajectory with vmd and from the rdf analysis this atom "moves from the solvent" to the substrate ending doing a covalent bond with the N of the substrate. The same data si confirmed in the rdf showing a peak at 1.10 A and g(r) 100 for this N-H interaction.
Now i'm using this script to analysis the number of this H-bond (as further proof that this interaction occurs in most of the frames)
and i get only these numbers of H-bonds:
Interazioni H-bond totali tra idrogeno 1263 e azoto 13: 23
Media H-bonds/frame (tutti i frame): 0.11.
There is obviously a mismatch but i'm getting crazy to understand why.
I have already checked the connectivity between the atoms indicated in the indexes and i have tried to change the cutoff also, but nothing,
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions