Hi, I'm up against a horrible deadline so I'm hoping for some help figuring out what I'm doing wrong.

I have a list of custom atom names in Gromacs of which I want to perform hydrogen bond analysis using MDAnalysis. As great as MDAnalysis is, I can't find enough documentation to help decipher how to fit in custom atom names.

Firstly, if you define a new class:

class HydrogenBondAnalysis_OtherFF(hbonds.HydrogenBondAnalysis):

DEFAULT_DONORS = {"OtherFF": tuple(set(["DH1","DH20","DH19","DH11","DH25","DH27","DH30"]))}

DEFAULT_ACCEPTORS = {"OtherFF": tuple(set(["DO1","DN2","DN6","DN5","DN4","DN3","DO2","DO3","DO4","DO5"]))}

Will this override everything? i.e., I can no longer use either protein or water in a selection.

Secondly, if the above is NOT true then I can't seem to get this working:

import MDAnalysis

import MDAnalysis.analysis.hbonds as hbonds

import pandas as pd

referenceFile = "/Users/anthonynash/Documents/AGES/DIC_CHEMRXIV/SIMULATIONS/DOGDIC/fixed_dihedrals.tpr"

trajectoryFile = "/Users/anthonynash/Documents/AGES/DIC_CHEMRXIV/SIMULATIONS/DOGDIC/fixed_dihedrals_nojump.xtc"

universe = MDAnalysis.Universe(referenceFile, trajectoryFile)

class HydrogenBondAnalysis_OtherFF(hbonds.HydrogenBondAnalysis):

DEFAULT_DONORS = {"OtherFF": tuple(set(["DH1","DH20","DH19","DH11","DH25","DH27","DH30"]))}

DEFAULT_ACCEPTORS = {"OtherFF": tuple(set(["DO1","DN2","DN6","DN5","DN4","DN3","DO2","DO3","DO4","DO5"]))}

hydrogenBondAnalysis = HydrogenBondAnalysis_OtherFF(universe, 'name DO1 DN2 DN6 DN5 DN4 DN3 DO2 DO3 DO4 DO5 DH20 DH19 DH11 DH25 DH27 DH30', 'resname SOL', distance=3.0, angle=120.0, forcefield=“OtherFF”)

hydrogenBondAnalysis.run()

I get the warnings:

/usr/local/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No donors found in selection 1. You might have to specify a custom 'donors' keyword. Selection will update so continuing with fingers crossed.

warnings.warn(errmsg, category=SelectionWarning)

/usr/local/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No acceptors found in selection 1. You might have to specify a custom 'acceptors' keyword. Selection will update so continuing with fingers crossed.

warnings.warn(errmsg, category=SelectionWarning)

/usr/local/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No acceptors found in selection 2. You might have to specify a custom 'acceptors' keyword. Selection will update so continuing with fingers crossed.

warnings.warn(errmsg, category=SelectionWarning)

/usr/local/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No donors found in selection 2. You might have to specify a custom 'donors' keyword. Selection will update so continuing with fingers crossed.

warnings.warn(errmsg, category=SelectionWarning)

More Anthony Nash's questions See All
Similar questions and discussions