rush.convert¶
Conversion utilities for molecular structure file formats.
This module provides functions to convert between PDB, mmCIF, SDF, and QDX’s TRC JSON formats.
- rush.convert.merge_trcs(*trcs, output_file=None, skip_validation=False)[source]¶
Merge TRC objects into a single TRC.
A TRC (Topology-Residues-Chains) object contains: - topology: atom information (symbols, geometry, bonds, charges, etc.) - residues: residue information (which atoms belong to which residues) - chains: chain information (which residues belong to which chains)
When merging, atom indices, residue indices, and chain indices are renumbered to ensure uniqueness in the merged structure.
- Parameters:
trcs (TRC | str | Path | list[TRC | str | Path] | tuple[TRC | str | Path, ...]) – TRC objects or file paths. If a single list/tuple is provided, it is treated as the full set of inputs.
output_file (str | Path | None) – Optional path to write the merged TRC JSON.
skip_validation (bool) – If True, skip validation of the merged TRC.
- Returns:
Merged TRC object.
- Raises:
ValueError – If no inputs are provided or validation fails.
FileNotFoundError – If file paths are provided but files don’t exist.
- Return type: