schrodinger.application.transforms.chemio module¶
- class schrodinger.application.transforms.chemio.WriteBatchesOfStructures(file_prefix: Union[str, Path])¶
Bases:
_LocalOnlyPTransform,WriteBatchesOfStructuresA PTransform that writes each element (which is a list of structures) to a separate file with a unique filename. Note that this transform is an identity step that outputs the input PCollection.
- class schrodinger.application.transforms.chemio.ReadFileToStructures(input_file: str)¶
Bases:
PTransformRead Structure objects from a file.
This is a source transform that reads structures from a file.
Example usage in YAML:
pipeline: - type: ReadFileToStructures config: input_file: "ligands.maegz"
- Parameters:
input_file – Path to the structure file to read.
- __init__(input_file: str)¶
- expand(pbegin: PBegin)¶
- class schrodinger.application.transforms.chemio.WriteStructures(output_file: str)¶
Bases:
PTransformWrite Structure objects to a file.
This is a sink transform that writes structures to a file. It passes through the input structures unchanged for chaining.
Example usage in YAML:
pipeline: - type: ReadFileToStructures config: input_file: "ligands.maegz" - type: LigFilter config: criteria: ["Num_heavy_atoms > 5"] - type: WriteStructures config: output_file: "filtered.maegz"
- Parameters:
output_file – Path to the output structure file.
- __init__(output_file: str)¶
- class schrodinger.application.transforms.chemio.CreateStructuresFromSmiles(elements: Iterable[str])¶
Bases:
PTransformCreate Structure objects from a list of SMILES strings.
This is a source transform that creates structures from SMILES.
Example usage in YAML:
pipeline: - type: CreateStructuresFromSmiles config: elements: - "c1ccccc1" - "CCO"
- Parameters:
elements – List of SMILES strings to convert to structures.
- __init__(elements: Iterable[str])¶
- expand(pbegin: PBegin)¶
- class schrodinger.application.transforms.chemio.StructureToRow(label: Optional[str] = None)¶
Bases:
PTransformConvert Structure objects to Beam Rows.
This transform wraps each Structure in a Row with a ‘structure’ field, enabling use of Row-based transforms like MapToFields.
Example usage in YAML:
pipeline: - type: CreateStructuresFromSmiles config: elements: - "c1ccccc1" - type: LigFilter config: criteria: ["Num_heavy_atoms > 3"] - type: StructureToRow - type: MapToFields config: fields: title: callable: "lambda row: row.structure.title"