rxn.reaction_preprocessing.standardizer.Standardizer

class rxn.reaction_preprocessing.standardizer.Standardizer(annotations, discard_unannotated_metals, reaction_column_name, fragment_bond=None, remove_stereo_if_not_defined_in_precursors=False, keep_intermediate_columns=False)[source]

Bases: object

Parameters
  • annotations (List[MoleculeAnnotation]) –

  • discard_unannotated_metals (bool) –

  • reaction_column_name (str) –

  • fragment_bond (Optional[str], default: None) –

  • remove_stereo_if_not_defined_in_precursors (bool, default: False) –

  • keep_intermediate_columns (bool, default: False) –

__init__(annotations, discard_unannotated_metals, reaction_column_name, fragment_bond=None, remove_stereo_if_not_defined_in_precursors=False, keep_intermediate_columns=False)[source]

Creates a new instance of the Standardizer class.

Parameters
  • annotations (List[MoleculeAnnotation]) – A list of MoleculeAnnotation objects used to perform the substitutions/rejections

  • discard_unannotated_metals (bool) – whether reactions containing unannotated molecules with transition metals must be rejected.

  • reaction_column_name (str) – The name of the DataFrame column containing the reaction SMILES.

  • fragment_bond (Optional[str], default: None) – the fragment bond used in the dataframe.

  • remove_stereo_if_not_defined_in_precursors (bool, default: False) – Remove chiral centers from products.

  • keep_intermediate_columns (bool, default: False) – Whether the columns generated during preprocessing should be kept.

Methods

__init__(annotations, ...[, fragment_bond, ...])

Creates a new instance of the Standardizer class.

standardize_file(input_csv, output_csv)

Standardize the reactions in a CSV file.

standardize_iterator(csv_iterator)

Standardize the reactions in a CSV iterator.

standardize_one(rxn_smiles)

param rxn_smiles

standardize_file(input_csv, output_csv)[source]

Standardize the reactions in a CSV file.

Parameters
  • input_csv (Path) – CSV with the reactions to standardize.

  • output_csv (Path) – CSV where to save the standardized reactions.

Return type

None

standardize_iterator(csv_iterator)[source]

Standardize the reactions in a CSV iterator.

Same as standardize_file, except that it acts directly on the iterator.

Parameters

csv_iterator (CsvIterator) – input CSV iterator for the reactions to standardize.

Return type

CsvIterator

Returns

CsvIterator with reactions after the standardization step.