Prepare

Structure preparation module for the Rush Python client.

Usage:

from rush import prepare

# Protein only
result = prepare.protein("protein.pdb").fetch()

# Protein-ligand complex
result = prepare.protein_ligand("complex.pdb", ligand_names=["LIG"]).fetch()
class rush.prepare.ResultRef(models)[source]

Bases: object

Lightweight reference to prepare-protein output in the Rush object store.

May contain multiple TRC triplets if the input PDB has multiple models.

Parameters:

models (list[TRCRef])

classmethod from_raw_output(res)[source]

Parse raw collect_run output into a ResultRef.

The raw output is a list of groups, where each group is a list of 3 dicts (topology, residues, chains objects). Multi-model PDBs produce multiple groups.

Parameters:

res (Any)

Return type:

ResultRef

fetch()[source]

Download prepare-protein output and parse into TRCs.

Returns one TRC per model in the input PDB. Most PDBs contain a single model, so result[0] is the common pattern.

Return type:

list[TRC]

save()[source]

Download prepare-protein output and save to the workspace.

Returns one TRCPaths per model in the input PDB.

Return type:

list[TRCPaths]

models: list[TRCRef]
rush.prepare.protein(mol, ph=None, naming_scheme=None, capping_style=None, truncation_threshold=None, opt=None, debump=None, run_spec=RunSpec(gpus=1), run_opts=RunOpts())[source]

Submit a prepare-protein job for a PDB or TRC file.

Returns a RushRun handle. Call .fetch() to get the parsed TRC, or .save() to write the output files to disk.

Parameters:
  • mol (TRC | TRCRef | tuple[Path | str | RushObject | Topology, Path | str | RushObject | Residues, Path | str | RushObject | Chains] | Path | str)

  • ph (float | None)

  • naming_scheme (Literal['AMBER', 'CHARMM'] | None)

  • capping_style (Literal['never', 'truncated', 'always'] | None)

  • truncation_threshold (int | None)

  • opt (bool | None)

  • debump (bool | None)

  • run_spec (RunSpec)

  • run_opts (RunOpts)

Return type:

RushRun[ResultRef]

rush.prepare.protein_ligand(mol, ligand_names, ph=None, naming_scheme=None, capping_style=None, truncation_threshold=None, opt=None, debump=None, run_spec=RunSpec(gpus=1), run_opts=RunOpts())[source]

Submit a complex preparation job for a PDB or TRC file.

Internally runs prepare-protein, extracts ligands, merges, and uploads the combined TRC. The returned RushRun wraps the prepare-protein job. Calling .fetch() or .save() blocks until the protein preparation completes, then performs the merge locally.

Returns a RushRun handle. Call .fetch() to get the parsed TRC, or .save() to write the output files to disk.

Parameters:
  • mol (TRC | Path | str)

  • ligand_names (list[str])

  • ph (float | None)

  • naming_scheme (Literal['AMBER', 'CHARMM'] | None)

  • capping_style (Literal['never', 'truncated', 'always'] | None)

  • truncation_threshold (int | None)

  • opt (bool | None)

  • debump (bool | None)

  • run_spec (RunSpec)

  • run_opts (RunOpts)

Return type:

RushRun[ResultRef]