plinder.data.annotations.interface_utils#

Protein-interface detection in deposited biological assemblies.

class plinder.data.annotations.interface_utils.ProdigyCrystalAnnotation(label: str, probability_bio: float, link_density: float, intermolecular_contacts: int, charged_charged_contacts: int, charged_polar_contacts: int, charged_apolar_contacts: int, polar_polar_contacts: int, apolar_polar_contacts: int, apolar_apolar_contacts: int)[source]#

Bases: object

PRODIGY-cryst contact features and BIO/XTAL prediction.

label: str#
probability_bio: float#
intermolecular_contacts: int#
charged_charged_contacts: int#
charged_polar_contacts: int#
charged_apolar_contacts: int#
polar_polar_contacts: int#
apolar_polar_contacts: int#
apolar_apolar_contacts: int#
plinder.data.annotations.interface_utils.interface_system_id(pdb_id: str, biounit_id: str, chain_1: str, chain_2: str) → str[source]#

Return the system ID for an unordered assembly-chain pair.

class plinder.data.annotations.interface_utils.ProteinInterface(pdb_id: str, biounit_id: str, chain_1: str, chain_2: str, chain_1_residue_numbers: tuple[int, ...], chain_1_residue_indices: tuple[int, ...], chain_2_residue_numbers: tuple[int, ...], chain_2_residue_indices: tuple[int, ...], num_contact_residue_pairs: int, prodigy: ProdigyCrystalAnnotation | None = None, contact_area: float | None = None)[source]#

Bases: object

One unordered protein-chain interface in one biological assembly.

pdb_id: str#
biounit_id: str#
chain_1: str#
chain_2: str#
chain_1_residue_numbers: tuple[int, ...]#
chain_1_residue_indices: tuple[int, ...]#
chain_2_residue_numbers: tuple[int, ...]#
chain_2_residue_indices: tuple[int, ...]#
num_contact_residue_pairs: int#
prodigy: ProdigyCrystalAnnotation | None = None#
contact_area: float | None = None#
property system_id: str#
to_row() → dict[str, object]#

Return one Arrow-compatible annotation row.

plinder.data.annotations.interface_utils.annotate_prodigy_crystal_interface(atoms: struc.AtomArray, *, chain_1: str, chain_2: str, spatial_index: BiounitSpatialIndex) → ProdigyCrystalAnnotation | None[source]#

Classify one chain interface using official PRODIGY-cryst.

Its contact definitions, feature ordering and fixed random forest are preserved. Biotite supplies the already reconstructed biological assembly, and NumPy evaluates the legacy scikit-learn trees. Interfaces containing unsupported modified residues remain in the dataset with null PRODIGY fields.

plinder.data.annotations.interface_utils.find_protein_chain_contacts(atoms: struc.AtomArray, *, chains: Mapping[str, Chain], contact_radius: float, spatial_index: BiounitSpatialIndex) → ProteinChainContacts[source]#

Return residue contacts between every pair of polypeptide chains.

plinder.data.annotations.interface_utils.detect_protein_interfaces(atoms: struc.AtomArray, *, pdb_id: str, biounit_id: str, chains: Mapping[str, Chain], contact_radius: float = 10.0, min_chain_length: int = 12, min_interface_residues: int = 7, annotate_prodigy: bool = True, spatial_index: BiounitSpatialIndex | None = None, chain_pair_contact_areas: Mapping[tuple[str, str], float] | None = None, chain_contacts: ProteinChainContacts | None = None) → list[ProteinInterface][source]#

Detect protein-chain interfaces from backbone contacts.

Every eligible polypeptide chain has a SEQRES length of at least min_chain_length. A residue belongs to an interface when one of its N, CA, C or O atoms lies within contact_radius of a backbone atom in another eligible assembly-chain instance. Interfaces are retained only when both sides contain at least min_interface_residues resolved residues.

chain_pair_contact_areas are the assembly-wide Voronota-LT areas keyed by sorted chain pair; when given, each interface records its pair’s area (0.0 for backbone-defined interfaces without atomic contact), otherwise contact_area stays None.

plinder.data.annotations.interface_utils.protein_interfaces_to_table(interfaces: Iterable[ProteinInterface], *, min_interface_residues: int = 7) → Table[source]#

Return a typed table with the ingest threshold in schema metadata.

plinder.data.annotations.interface_utils.min_interface_residues_from_schema(schema: Schema) → int[source]#

Read the interface threshold recorded on an interface table.