schrodinger.application.transforms.debug module¶
Apache Beam transforms for debugging and utility operations in YAML pipelines.
- class schrodinger.application.transforms.debug.PrettyPrint(expand: bool = False)¶
Bases:
PTransformPretty-print Beam Rows as JSON strings.
The
expandconfiguration option controls the formatting:If
expandis True, the JSON output is printed with indentation across multiple lines.If
expandis False (default), the JSON output is compact and printed on a single line.
Example usage in YAML:
pipeline: - type: ReadFileToStructures config: input_file: "ligands.maegz" - type: StructureToRow - type: PrettyPrint config: expand: true
- Parameters:
expand – Whether to pretty-print with indentation.
- __init__(expand: bool = False)¶
- class schrodinger.application.transforms.debug.ExtractFieldFromRow(field_name: str)¶
Bases:
PTransformExtract a field from Row objects, yielding the field value.
This is useful when a transform expects a specific type (like Structure) but the pipeline uses Row objects. Extract the field before the transform, then optionally wrap it back in a Row after.
Example usage in YAML:
pipeline: - type: ReadFromPDB config: pdb_codes: - "1A2B" - type: StructureToRow - type: ExtractFieldFromRow config: field_name: "structure"
This would transform
Row(structure=Structure(...), other=value)into just the Structure object.- Parameters:
field_name – The name of the Row field to extract.
- __init__(field_name: str)¶
- class schrodinger.application.transforms.debug.WrapInRow(field_name: str)¶
Bases:
PTransformWrap values in a Row with a specified field name.
This is useful when a transform returns bare values (like Structure) but the pipeline expects Row objects. Wrap the values in a Row so subsequent transforms can access them via the field name.
Example usage in YAML:
pipeline: - type: CreateMolsFromSmiles config: elements: - "c1ccccc1" - type: WrapInRow config: field_name: "mol"
This would transform a bare Mol into
Row(mol=Mol(...)).- Parameters:
field_name – The name of the Row field to create.
- __init__(field_name: str)¶