plinder.data.annotations.affinity#

Select an unambiguous BindingDB measurement for a receptor.

plinder.data.annotations.affinity.candidate_map(candidates: DataFrame) → dict[str, list[dict[str, Any]]][source]#

Index strict BindingDB candidates by reported PDB/ligand code.

plinder.data.annotations.affinity.matched_affinity(candidates: Sequence[Mapping[str, Any]], receptor_seqres: Mapping[str, str]) → tuple[float, str, int] | None[source]#

Return pKi/pKd, endpoint, and measurement count for one target match.

Candidates have already passed the within-target assay/qualifier checks. A missing receptor sequence or multiple matching target sequences is ambiguous, so neither produces a scalar affinity.

plinder.data.annotations.affinity.build_ligand_affinity_table(annotation_path: Path, entry_chains_path: Path, candidates_path: Path, *, pdb_ids: Collection[str] | None = None) → DataFrame[source]#

Assign BindingDB candidates to ligands using their receptor chains.

A BindingDB PDB/CCD cross-reference alone is not sufficient evidence for the scalar value. Unmatched or ambiguous ligands retain null values here.

plinder.data.annotations.affinity.publish_affinity_tables(data_dir: Path, *, affinity_dir: Path | None = None, base_dir: Path | None = None, changed_pdb_ids: Collection[str] = (), removed_pdb_ids: Collection[str] = ()) → None[source]#

Write corrected ligand values and source measurements beside the index.