pyqmmm.md.hbond_compare
¶
Analyze data from hydrogen bonding analysis based on hbond.gnu file.
Module Contents¶
Functions¶
|
Extracts bond labels from gnu file. |
|
Counts percent occurrences of each hydrogen bond. |
|
Cleans up hbonding data (formats residue names, dataframe index, etc.) |
Sets formatting for matplotlib. |
|
|
Plot single figure for hbonding analysis. |
|
Plot hbonding comparison between two trajectories. |
|
Driver for analyzing hbonds from hbond.gnu file |
- pyqmmm.md.hbond_compare.bond_labels(file_path, ignore_backbone=True, include_backbone=tuple('DHK'))[source]¶
Extracts bond labels from gnu file.
- Parameters:
file_path (str) – Path to hbond.gnu file
ignore_backbone (bool) – Whether to ignore backbone hydrogen bonds (donor/acceptor named N or O)
include_backbone (tuple(str)) – If ignore_backbone, these residues are the exception
- Returns:
grouped – DataFrame containing residue pair and interaction index
- Return type:
pd.DataFrame
- pyqmmm.md.hbond_compare.count_occurrences(file_path, labels)[source]¶
Counts percent occurrences of each hydrogen bond.
- Parameters:
file_path (str) – Path to hbond.gnu file
labels (str) – Hbond labels as outputted by CPPTRAJ in gnu format
- Returns:
labels (DataFrame containing residue pair and interaction index)
frame_count (total number of frames in trajectory)
- pyqmmm.md.hbond_compare.process_data(count_df, frame_count, name, substrate)[source]¶
Cleans up hbonding data (formats residue names, dataframe index, etc.)
- Parameters:
count_df (pd.DataFrame) – DataFrame containing the hydrogen bonding counts
frame_count (int) – Number of frames in trajectory
name (str) – System name
- Returns:
count_df – Cleaned DataFrame containing the hydrogen bonding counts
- Return type:
pd.DataFrame
- pyqmmm.md.hbond_compare.plot(data, file_path)[source]¶
Plot single figure for hbonding analysis.
- Parameters:
data (pd.DataFrame) – Data that will be used to plot the figure
file_path (str) – Path to directory where output image should go