rxn.reaction_preprocessing.preprocessor.Preprocessor
- class rxn.reaction_preprocessing.preprocessor.Preprocessor(mixed_reaction_filter, reaction_column_name, fragment_bond='.')[source]
Bases:
object- Parameters
mixed_reaction_filter (
MixedReactionFilter) –reaction_column_name (
str) –fragment_bond (
str, default:'.') –
- __init__(mixed_reaction_filter, reaction_column_name, fragment_bond='.')[source]
- Parameters
mixed_reaction_filter (
MixedReactionFilter) – mixed reaction filter.reaction_column_name (
str) – The name of the DataFrame column containing the reaction SMARTS.fragment_bond (
str, default:'.') – The token that represents fragment bonds in the reaction SMILES.
Methods
__init__(mixed_reaction_filter, ...[, ...])- type mixed_reaction_filter
Prints statistics of the filtration to the logger.
process_file(input_file_path, output_file_path)Process the reactions in a CSV file.
process_iterator(csv_iterator)Process the reactions in a CSV iterator.
- process_file(input_file_path, output_file_path)[source]
Process the reactions in a CSV file.
- Parameters
input_file_path (
Union[str,PathLike]) – CSV with the reactions to standardize.output_file_path (
Union[str,PathLike]) – CSV where to save the standardized reactions.
- Return type
None
- process_iterator(csv_iterator)[source]
Process the reactions in a CSV iterator.
Same as
process_file, except that it acts directly on the iterator.- Parameters
csv_iterator (
CsvIterator) – input CSV iterator for the reactions to process.- Return type
CsvIterator- Returns
CsvIterator with reactions after the processor step.