Expected behavior for copy.deepcopy to remove explicit H's? #6328
-
Hi, In trying to clone a molecule by either a) mol2 = Chem.rdchem.Mol(mol1) or b) mol2 = copy.deepcopy(mol1), I notice that an explicit H used for stereochemistry designation has been removed and the hash bond has been moved elsewhere (see attached pic). Even though the movement of the hash bond does not change the configuration of the stereocenter, I don't think the explicit H violates any IUPAC drawing rules. Is this expected behavior? Are other alternations expected/possible under these cloning methods? Is there a way to get a clone without such changes? I'm using Debian:
Example code (using V2000 mol/sdf as input):
Thank you for any guidance. Best, Andrew |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @someonetookmyname You are using a quite old version of the RDKit. I can't reproduce what you're reporting or see if it still happens in a newer RDKit version unless you share the input file you used. |
Beta Was this translation helpful? Give feedback.
Hi Greg,
I've resolved this. I didn't realize that SDMolSupplier() had additional arguments, let alone removeHs which defaults to True.
I had been comparing the input SDF to the post-copy structures, not the post-import structure to the post-copy structures.
When I use removeHs=False during import, the explicit H's stay put in both cloning methods.
Apologies for not being aware of that sooner.
Thanks for the help.
Best,
Andrew