Skip to content

Commit 0f789fd

Browse files
committed
chore: add descriptions to more functions
1 parent a90cb17 commit 0f789fd

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

src/plinder/data/utils/annotations/interface_gap.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,28 @@ def annotate_interface_gaps(
111111
larger_radius: float = 8.0,
112112
use_author_fields: bool = False,
113113
) -> dict[str, Any]:
114+
"""
115+
Annotate interface atoms in close proximity to gaps.
116+
117+
Parameters
118+
----------
119+
cif_file: Path
120+
System mmcif file
121+
protein_chains: list[str] | None = None
122+
Protein chains
123+
ligand_chains: list[str] | None = None
124+
Ligand chains
125+
smaller_radius: float = 4.0
126+
Smaller radius used for extracting neighboring atoms
127+
larger_radius: float = 8.0
128+
Larger radius used for extracting neighboring atoms
129+
use_author_fields: bool = False
130+
Use author-defined fields
131+
Returns
132+
-------
133+
dict[str, Any]
134+
Dictionary of interface atoms near gaps
135+
"""
114136
pdb_id = cif_file.stem.split("_")[0].replace("pdb_0000", "")
115137

116138
if ".cif" in cif_file.name:

src/plinder/data/utils/annotations/ligand_utils.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,18 @@ def annotate_interface_gaps_per_chain(
580580
interface_proximal_gaps: dict[str, dict[tuple[str, str], dict[str, int]]],
581581
asym_id: str,
582582
) -> tuple[int | None, ...]:
583+
"""Parse protein-ligand and protein-protein interface atoms in proximity to gaps
584+
to count interface atoms within 4 Å and within 8 Å of gaps.
585+
This focuses on a specific ligand chain and the interfaces and gaps around it.
586+
587+
Args:
588+
interface_proximal_gaps (dict[str, dict[tuple[str, str], dict[str, int]]]):
589+
Interface atoms close to gaps (within 4 Å and 8 Å )
590+
asym_id: str
591+
Asymmetric unit chain id
592+
Returns:
593+
tuple[int, int, int, int, int, int]
594+
"""
583595
try:
584596
ppi_atoms_within_4A_of_gap = sum(
585597
[
@@ -989,7 +1001,7 @@ def from_pli(
9891001
ligand_like_chains: dict[str, str]
9901002
Chain: chain type for other ligand-like chains in the entry
9911003
interface_proximal_gaps: dict[str, dict[tuple[str, str], dict[str, int]]]
992-
TODO: document
1004+
Dictionary of protein-ligand and protein-protein interface atoms in proximity to residue gaps
9931005
all_covalent_dict : dict[str, list[tuple[str, str]]]
9941006
All "covalent" residue in entry as defined by mmcif annotations.
9951007
They types are separated by dictionary key and they include:

src/plinder/data/utils/annotations/mmpdb_utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,6 @@ def add_mmp_clusters_to_data(
264264
pocket_similarity_dict
265265
)
266266

267-
# Load mmp index
268-
# load_mmp_df = pd.read_csv(mmp_index, compression="gzip", sep="\t", header=None)
269-
# load_mmp_df.columns = ["SMILES1", "SMILES2", "id1", "id2", "V1>>V2", "CONSTANT"]
270-
271267
# Pad interger lig ids with zeros
272268
load_mmp_df["id1"] = load_mmp_df.id1.apply(pad_integer_lig_ids_with_zeros)
273269
load_mmp_df["id2"] = load_mmp_df.id2.apply(pad_integer_lig_ids_with_zeros)

0 commit comments

Comments
 (0)