To generate a DeepSMILES string we transform a SMILES string into an alternative syntax that preserves atom order but modifies ring closure symbols and parentheses (see Table ). The transformation process does not require chemical interpretation of SMILES but only involves string processing of the syntax. As such, it makes certain assumptions about the form of the SMILES string that be met if the SMILES string was generated by a standard cheminformatics toolkit, but may not be met otherwise. For example, the code assumes that the SMILES was generated as a depthfirst traversal of the molecular graph. For example, this assumption is not met by the SMILES string CC(C1)CCCC1 which cannot be encoded as DeepSMILES (at least, while preserving the atom order). The solution is simply to roundtrip such SMILES through such a cheminformatics toolkit to generate the form required.