poli.core.util.chemistry.string_to_molecule.translate_smiles_to_selfies

poli.core.util.chemistry.string_to_molecule.translate_smiles_to_selfies#

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

Translates a list of SMILES strings to SELFIES strings.

Given a list of SMILES strings, returns the translation into SELFIES strings. If strict is True, it raises an error if a SMILES 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
  • smiles_strings (List[str]) – A list of SMILES strings.

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

Returns

A list of SELFIES strings.

Return type

List[str]