schrodinger.application.transforms.ligprep.summary module

End-of-run summary log for the LigPrep4 pipeline, reproducing the legacy ligprep3 .log body (see macromodel-src/ligprep3/ligprep3_backend.py).

Beam stages fan out and drop structures independently, so per-input accounting cannot be reconstructed afterwards. Instead each stage routes survivors to its OutcomeParDo main output and failures to its dropped output as DroppedRecord objects; LigPrep4 derives one tally record per structure from those two streams (a survivor counts as out, a dropped record as fail) and writes them to a file that format_summary renders. Records are keyed by the structure’s root SourceID so every structure derived from one input shares a key. Each record also carries the input’s original index and title (from the root FileSourceID) so the always-on head stage’s tally supplies every table row.

For the stages that drop on failure (DROPPING_STAGES), LigPrep4 joins their DroppedRecord objects back to the original inputs by root SourceID and writes one original input per dropped molecule, each stamped with an s_lp_failure_stage property.

class schrodinger.application.transforms.ligprep.summary.StageMeta(label: str, nickname: str, legacy_name: str)

Bases: NamedTuple

Static per-stage metadata for the summary log.

label: str

Alias for field number 0

nickname: str

Alias for field number 1

legacy_name: str

Alias for field number 2

schrodinger.application.transforms.ligprep.summary.earliest_stage(labels) → str

Return the label that comes first in pipeline order (STAGE_META).

Used to attribute a single failure stage to a dropped input when its derived structures failed at different stages: the earliest one is the first point along the pipeline where the molecule started losing derivatives.

schrodinger.application.transforms.ligprep.summary.tally_record(st: Structure, stage: str, *, passed: bool) → dict

Build a per-structure tally record for one stage outcome.

A surviving structure contributes out=1; a dropped one contributes fail=1. format_summary sums these per (key, stage) to rebuild the legacy counts table. The record is keyed by the structure’s root SourceID and carries the original input’s index and title (from the root FileSourceID).

Parameters:
  • st – The structure whose outcome is recorded; for a drop this is the DroppedRecord’s original input.

  • stage – The stage label (a STAGE_META name).

  • passed – True for a survivor, False for a dropped structure.

schrodinger.application.transforms.ligprep.summary.count_dropped_inputs(records: list) → int

Count distinct input molecules that had a failure at a dropping stage.

Parameters:

records – Parsed tally records (dicts) from the pipeline.

schrodinger.application.transforms.ligprep.summary.format_summary(records: list, config, *, output_file: str, dropped_file: str, command: str, elapsed_s: float, version: int = None) → str

Render the ligprep-style summary log from collected tally records.

Parameters:
  • records – Parsed tally/roster records (dicts) from the pipeline.

  • config – The LigPrep4Config the pipeline ran with.

  • output_file – Path structures were written to (for the totals line).

  • dropped_file – Path the dropped original inputs were written to.

  • command – The reconstructed $SCHRODINGER/ligprep ... command line.

  • elapsed_s – Wall-clock run time in seconds.

  • version – mmshare version int; fetched from schrodinger if omitted.

Returns:

The full summary log text.