Work with protein interfaces#
Start from a selected interface ID and rebuild its two-chain coordinate view. Use Query the release tables to select interfaces and Protein interfaces for the column definitions.
import biotite.structure as struc
import pandas as pd
from plinder.core import PlinderInterface
/home/runner/micromamba/envs/plinder/lib/python3.12/site-packages/vcs_versioning/_backends/_git.py:709: UserWarning: "/home/runner/work/plinder/plinder" is shallow and may cause errors
pre_parse(wd)
Rebuild one interface#
PlinderInterface expands the two selected assembly-chain instances from the source mmCIF revision recorded by the release.
interface = PlinderInterface(system_id="7cm8__1__1.A--2.A")
interface
PlinderInterface(system_id='7cm8__1__1.A--2.A')
pd.DataFrame(
{
"chain": interface.chains,
"full_sequence_length": [
len(interface.sequences[chain]) for chain in interface.chains
],
"resolved_atom_count": [
len(interface.chain_structures[chain]) for chain in interface.chains
],
}
)
removing non-physical bond O@LEU53 <-> NA@NA1 (3.20 A > 3.16 A); likely inter-residue inference (get_assembly).
removing non-physical bond O@LEU53 <-> NA@NA1 (3.20 A > 3.16 A); likely inter-residue inference (get_assembly).
| chain | full_sequence_length | resolved_atom_count | |
|---|---|---|---|
| 0 | 1.A | 350 | 2258 |
| 1 | 2.A | 350 | 2258 |
sequences contains the full deposited polymer sequences; coordinate arrays contain only resolved atoms.
Interface residues and coordinate views#
The residue masks are defined over the complete two-chain atom_array. Their keys match the assembly-chain IDs in interface_annotations.
summary = []
for chain, mask in interface.interface_residue_masks.items():
atoms = interface.atom_array[mask]
summary.append(
{
"chain": chain,
"interface_residues": struc.get_residue_count(atoms),
"interface_atoms": len(atoms),
}
)
pd.DataFrame(summary)
| chain | interface_residues | interface_atoms | |
|---|---|---|---|
| 0 | 1.A | 100 | 757 |
| 1 | 2.A | 100 | 757 |
print(f"Two-chain atoms: {len(interface.atom_array):,}")
print(f"Interface atoms: {len(interface.interface_structure):,}")
print(f"Reconstructed mmCIF: {interface.interface_cif}")
Two-chain atoms: 4,516
Interface atoms: 1,514
Reconstructed mmCIF: /home/runner/.local/share/plinder/2026-09/reconstructed_interfaces/7cm8__1__1.A--2.A/interface.cif
interface_cif is a pathlib.Path; atom_array, the values of chain_structures, and interface_structure are Biotite AtomArray objects. The written mmCIF is self-contained and contains only the selected interface chains.