plinder.eval.inputs#

Prepare coordinate inputs without contact detection or artifact classification.

plinder.eval.inputs.reference_ligands(reference: PlinderSystem, *, include_all_ligands: bool = False) → dict[str, Path][source]#

Select reference poses by release ligand ID, proper ligands by default.

Uses the reference annotation, not a fresh classification of the prediction. A covalent multi-chain ligand remains one complete SDF molecule.

class plinder.eval.inputs.PreparedPrediction(receptor: Path, ligands: dict[str, Path], receptor_molecule: Mol)[source]#

Bases: object

Persistent receptor and ligand files, plus a receptor for PoseBusters.

Ligand keys are supplied SDF filenames or original label asym IDs. Covalently connected mmCIF ligand chains form one molecule, keyed by their first asym ID.

receptor: Path#
ligands: dict[str, Path]#
receptor_molecule: Mol#
plinder.eval.inputs.prepare_prediction(model: str | Path | StructureInput, output_dir: str | Path, *, ligand_sdfs: Sequence[str | Path] | None = None, ligand_smiles: Mapping[str, str] | None = None, ligand_ccd_codes: Mapping[str, str] | None = None, ligand_chains: Sequence[str] = ()) → PreparedPrediction[source]#

Prepare a receptor with supplied SDFs, or extract poses from a full mmCIF.

With ligand_sdfs, model is the predicted receptor (PDB or mmCIF, optionally gzip-compressed). Each SDF contains one ligand in that receptor’s coordinate frame and supplies its own chemistry. Result IDs use the SDF filenames. An empty list represents a prediction with zero ligand poses. Chemistry mappings and ligand_chains apply to complete-mmCIF extraction.

Complete-mmCIF extraction selects non-water, non-polymer chains as candidate ligands, including distant poses, ions and artifacts. Protein and DNA/RNA polymers remain receptors. ligand_chains additionally selects polymer chains used as ligands, such as peptides, by their label asym IDs. Without entity metadata, chains containing amino-acid or nucleotide residues are treated as polymers unless explicitly selected as ligands. DNA/RNA inputs need their mmCIF polymer sequence metadata retained.

CCD/SMILES mappings use component names, e.g. {"LIG": "ATP"}. For SMILES, the heavy-atom order must match the CIF atom order; CCD templates use atom names or graph matching. Unknown chemistry raises an error with the components requiring bond information. This function does not decide which ligands to evaluate: select proper ligands on the reference instead.

Prepared SDFs and extracted receptors remain in output_dir; supplied receptors use their original paths. The RDKit receptor retains residue metadata for PoseBusters.