Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molecule layout seems bugging out #1035

Open
parit opened this issue Jan 29, 2024 · 1 comment
Open

Molecule layout seems bugging out #1035

parit opened this issue Jan 29, 2024 · 1 comment

Comments

@parit
Copy link

parit commented Jan 29, 2024

Hello,

I am generating image for this molecule using it's smiles representation
https://www.ebi.ac.uk/chebi/searchId.do?chebiId=58827

String smiles="C[C@]1(CC([O-])=O)[C@H](CCC([O-])=O)\\C2=C\\c3[nH]c(Cc4[nH]c(\\C=C5/N=C(/C=C1\\[NH2+]2)[C@@H](CCC([O-])=O)[C@]5(C)CC([O-])=O)c(CC([O-])=O)c4CCC([O-])=O)c(CCC([O-])=O)c3CC([O-])=O";
IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
SmilesParser smipar = new SmilesParser(bldr);
IAtomContainer mol = smipar.parseSmiles(smiles);
DepictionGenerator dptgen = new DepictionGenerator();
dptgen.withSize(200, 250)
	.withMolTitle()
	.withTitleColor(Color.DARK_GRAY);
dptgen.depict(mol).writeTo("chebi-58827.png");

The resulting image looks distorted when compared to what the ChEBI is drawing.
chebi-58827

@johnmay
Copy link
Member

johnmay commented Jan 31, 2024

Macrocycles are always tricky to depict, particularly when there are double bonds that need to display the correct configuration.

For example:

image
image

If you remove the double bond configurations (they are all delocalised here anyways) you get a better depiction since it can use the template.

C[C@]1(CC([O-])=O)[C@H](CCC([O-])=O)C2=Cc3[nH]c(Cc4[nH]c(C=C5N=C(C=C1[NH2+]2)[C@@H](CCC([O-])=O)[C@]5(C)CC([O-])=O)c(CC([O-])=O)c4CCC([O-])=O)c(CCC([O-])=O)c3CC([O-])=O

image

Leave this open as it should be possible to use the template if the double bond configuration is correct but I think it errs on the side of caution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants