poli.core.util.chemistry.string_to_molecule.translate_selfies_to_smiles

poli.core.util.chemistry.string_to_molecule.translate_selfies_to_smiles#

poli.core.util.chemistry.string_to_molecule.translate_selfies_to_smiles(selfies_strings: List[str], strict: bool = False) List[str]#

Translates a list of SELFIES strings to SMILES strings.

Given a list of SELFIES strings, returns the translation into SMILES strings. If strict is True, it raises an error if a SELFIES string in the list cannot be parsed. Else, it returns None for those.

This function uses the selfies package from Aspuru-Guzik’s lab. See aspuru-guzik-group/selfies

Parameters
  • selfies_strings (List[str]) – A list of SELFIES strings.

  • strict (bool, optional) – If True, raise an error if a SELFIES string in the list cannot be parsed.

Returns

smiles_strings – A list of SMILES strings.

Return type

List[str]