pytraj.hbond_.
DatasetHBond
(dslist=None)¶Bases: pytraj.base_holder.BaseDataHolder
Hold data for hbond analysis.
Attributes
data |
return pytraj.DatasetList |
donor_acceptor |
return a list of donor and acceptor |
values |
return raw numpy array |
Methods
get_amber_mask () |
return a list of distance mask and angle mask |
to_dict () |
return OrderedDict |
total_solute_hbonds () |
return total solute hbonds |
data
¶return pytraj.DatasetList
donor_acceptor
¶return a list of donor and acceptor
get_amber_mask
()¶return a list of distance mask and angle mask
to_dict
()¶return OrderedDict
total_solute_hbonds
()¶return total solute hbonds
See also: DatasetHBond.data.keys()
values
¶return raw numpy array
pytraj.hbond_.
hbond
(traj, mask='', solvent_donor=None, solvent_acceptor=None, distance=3.0, angle=135.0, image=False, series=True, options='', dtype='hbond', frame_indices=None, top=None)¶(combined with cpptraj doc) Searching for Hbond donors/acceptors in region specified by mask
.
Hydrogen bond is defined as A-HD, where A is acceptor heavy atom, H is hydrogen, D is
donor heavy atom. Hydrogen bond is formed when A to D distance < distance cutoff and A-H-D angle
> angle cutoff; if angle < 0 it is ignored.
Parameters: | traj : Trajectory-like mask : {str, 1D array-like}
solvent_donor : {None, str}, default None solvent_acceptor: {None, str}, deafult None
distance : float, default 3.0 (angstrom)
angle : float, 135.0 degree
dtype : return output’s type, default ‘hbond’ image : bool, default False series : bool, default True
options : str
|
---|---|
Returns: | out : DatasetHBond if series is True else return ‘DatasetList’ |
See also
to_amber_mask
Notes
Examples
>>> import pytraj as pt
>>> traj = pt.load_sample_data('tz2')
>>> # search hbond without including solvent
>>> data = pt.search_hbonds(traj, ':5,8')
>>> data
<pytraj.hbonds.DatasetHBond
donor_acceptor pairs : 2>
>>> data.donor_acceptor
['LYS8_O-GLU5_N-H', 'GLU5_O-LYS8_N-H']
>>> # get raw data, ndarray with shape=(n_hbonds+1, n_frames)
>>> # first array shows the total solute hbonds and other arrays shows
>>> # if hbond exists (1) or non-exists (0) for each frame
>>> data.values
array([[2, 2, 0, ..., 1, 1, 1],
[1, 1, 0, ..., 1, 1, 1],
[1, 1, 0, ..., 0, 0, 0]], dtype=int32)
>>> # search hbond including solvent
>>> hbonds = pt.search_hbonds(traj, ':5,8', solvent_donor=':WAT@O', solvent_acceptor=':WAT')
>>> hbonds
<pytraj.hbonds.DatasetHBond
donor_acceptor pairs : 8>
>>> hbonds.donor_acceptor
['LYS8_O-GLU5_N-H', 'GLU5_O-LYS8_N-H', 'LYS8_HZ1-V', 'LYS8_HZ2-V', 'GLU5_OE2-V', 'GLU5_O-V', 'GLU5_OE1-V', 'LYS8_HZ3-V']
>>> # 'GLU5_O-V' mean non-specific hbond between GLU5_O and solvent (:WAT in this case)