Utils
Random helper functions.
Functions Available:
per_residue_distance_to_site() Calculate the closest heavy atom distance of each residue to an mdtraj defined selection of a site of interest. You can write the results to file if desired. Optionally can choose to only calculate minimum side chain distances.
download_prep_tutorial_dataset() Download one of the tutorial datasets from google drive using gdown and unzip it.
The functions below should not be called directly by an end user
_prep_out_dir() Makes the folder if it doesn't exist and appends a '/' if not present at end of a string.
_filter_features_by_strings() Filter features to only include those that match one of the strings in the list provided.
download_prep_tutorial_dataset(drive_url, save_dir)
Download one of the tutorial datasets from google drive using gdown and unzip it.
Parameters
str
Google drive url to download the zip file from. Checked to see if a tutorial file.
str
Directory to save and unpack the tutorial files.
Source code in key_interactions_finder/utils.py
per_residue_distance_to_site(pdb_file, site_defintion, first_residue, last_residue, side_chain_only=False, out_file=None)
Calculate the closest heavy atom distance of each residue to an mdtraj defined selection of a site of interest. You can write the results to file if desired.
Parameters
str
Path to pdb file to use for the distance calculation.
str
mdtraj compatable defintion of the site of interest (i.e. binding site, active site etc..) See here for examples: https://mdtraj.org/1.9.3/atom_selection.html
int
First residue to measure the distance from.
int
Last residue to measure the distance to.
bool = False,
Choose whether you want to measure the minimum distance using only the side chain of each residue. If true, only the side chain atoms are used. For glycines (no side chain), the CA of the glycine is used instead.
Optional[str]
Path to output file to write out data.
Returns
dict Residue numbers are the keys and minimum distances are the values.