prolint.plotting.structure ========================== .. py:module:: prolint.plotting.structure .. autoapi-nested-parse:: Structure export module. This module provides functions for exporting contact metrics to PDB files for visualization in molecular viewers. Functions --------- .. autoapisummary:: prolint.plotting.structure.write_pdb Module Contents --------------- .. py:function:: write_pdb(contacts, metric: Literal['mean', 'max', 'sum', 'occupancy'] = 'occupancy', target_resname: Optional[str] = None, filename: Optional[str] = None, frame: int = 0) -> str Write contact metrics to a PDB file for visualization. Exports query atoms to a PDB file with metric values stored in the B-factor column for coloring in molecular viewers. :param contacts: Computed contact data. :type contacts: ComputedContacts :param metric: Metric to write to B-factor column. :type metric: {"mean", "max", "sum", "occupancy"}, default="occupancy" :param target_resname: Filter by database residue name (e.g., "CHOL"). :type target_resname: str, optional :param filename: Output filename. If None, creates a temporary file. :type filename: str, optional :param frame: Trajectory frame to use for coordinates. :type frame: int, default=0 :returns: Path to the written PDB file. :rtype: str .. rubric:: Examples >>> from prolint.plotting import write_pdb >>> pdb_path = write_pdb(contacts, metric="occupancy") >>> # Open in PyMOL/VMD and color by B-factor