rxn.chemutils.conversion.maybe_canonicalize

rxn.chemutils.conversion.maybe_canonicalize(smiles, check_valence=True)[source]

Canonicalize a SMILES string, but returns the original SMILES string if it fails.

Parameters
  • smiles (str) –

  • check_valence (bool, default: True) –

Return type

str