rxn.chemutils.multicomponent_smiles.apply_to_multicomponent_smiles

rxn.chemutils.multicomponent_smiles.apply_to_multicomponent_smiles(multicomponent_smiles, fn, fragment_bond=None)[source]

Apply a function to the individual compounds in a multi-component SMILES string.

Parameters
  • multicomponent_smiles (str) – multi-component SMILES string to apply the function to.

  • fn (Callable[[str], str]) – function to apply on the distinct molecule SMILES.

  • fragment_bond (Optional[str], default: None) – fragment bond to use when parsing.

Return type

str

Returns

New multi-component SMILES string after application of the function to the molecules.