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

Monomers Go Missing When Exported #2

Open
jvermaas opened this issue Feb 19, 2023 · 0 comments
Open

Monomers Go Missing When Exported #2

jvermaas opened this issue Feb 19, 2023 · 0 comments

Comments

@jvermaas
Copy link

I've been playing with LigninGraphs, and I think there is a problem with how the internal representation is converted to SMILES, and the beta-1 linkage seems to be the origin of the problem. Take the example script below:

import os
import numpy as np
import time
import matplotlib.pyplot as plt

import ligning.monomer as mono
import ligning.characterization as ch
import ligning.polymer as poly
import ligning.utils as ut
P0 = mono.Monomer("G")
polymer = poly.Polymer(P0)
polymer.add_specific_linkage('beta-beta', monomer_type = 'S')
polymer.add_specific_linkage('beta-O-4', monomer_type = 'H')
polymer.add_specific_linkage('beta-1', monomer_type = 'G')
polymer.add_specific_linkage('4-O-5', monomer_type = 'G')
polymer.add_specific_linkage('alpha-O-4', monomer_type = 'S')
polymer.add_specific_linkage('5-5', monomer_type = 'H')
polymer.add_specific_linkage('beta-5', monomer_type = 'G')
ut.draw_atomic_graph(polymer.G)
plt.savefig("test2.png")
fout = open("test.smi", "w")
fout.write("Title\n")
fout.write(ut.graph_to_smile(polymer.G)+"\n")
fout.close()
ut.draw_big_graph(polymer.bigG)
plt.savefig("test.png")

I have gotten all kinds of output, but the one I'm most concerned by is the SMILES string. This is the SMILES string I get with this input:

OCCCc1cc(OC)c(OC(CO)Cc2ccc(OC(CCO)c3cc(OC)c(O)c(OC)c3)cc2)c(c2c(O)ccc(C3C(c4c(O3)c(OC)cc(C=CCO)c4)CO)c2)c1

This only has 5 rings, whereas we would expect 8 based on the polymers I added. The png files for the graphs look fine (see attached), but the SMILES is a problem.

test
test2

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

1 participant