Skip to content

Generate drawable SMILES from molecule fragment #2564

@aaron-barbieriaghib

Description

@aaron-barbieriaghib

Hi,

I am relatively new to Rdkit and I apologize if this isn't the right place to ask this. I am dealing with molecule fragments in SMILES notation, such as 'cC(=O)N(C)C', and when I try to draw the molecule, I get the following error: ERROR: non-ring atom 0 marked aromatic. Now, of course I could set sanitize=False in my Chem.MolFromSmiles() function, but then I lose information in my drawing.

Is there a way to intelligently interpret the SMILES fragment, and create the simplest molecule that is valid, and highlight the parts that were in the original fragment? So in the 'cC(=O)N(C)C' example, I would want the first carbon to be part of an aromatic ring, and for the actual 'cC(=O)N(C)C' fragment to be highlighted. Is this at all possible?

Other examples are more complicated and involve multiple aromatic rings, such as 'cnnc' (or perhaps both nitrogens here are part of the same aromatic ring?).

Best,
Aaron

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions