-
Notifications
You must be signed in to change notification settings - Fork 12
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
Obtaining polymer structures for hydroxyacid isomers with given distribution #12
Comments
Hi Evelien, I'm not sure I understand how the description of your goal matches your code example, but from the example, I can see that the code is having issues with this monomer Jeff |
Hi Jeff, Thanks for your swift reply. I am trying to make structures of co-polyesters. For example, in PET a little bit of isophtalic acid (I) is often added. Thus, this PET will have a repeating unit structure of (ET)x-(EI)y. In order to model this, I split the two repeating units into their corresponding hydroxyacids HO-(ET)-COOH and HO-EI)-COOH with distribution [x,y] and polymerize them. I added the outcomes of my script as attachments (note that here I used para and meta substituted benzene rings). The top one is with the distribution specified and reports 3 polymers and 1 error, the bottom is one without distribution and reports 4 polymers (no errors). If I don't specify the distribution, I get a mix of para and meta benzene rings. That does not match your statement that if you don't specify a distribution only the 2nd monomer is taken, right? If I do specify a distribution (in this case all [1,1]), I obtain polymers for all cases where the diol length was unequal. I.e. not ethylene glycol-based for the 2nd monomer, but a C3 or C4 diol. However, these cases are very rare in the real-world ;-) So that's why I was really puzzled. I was expecting it to work in neither case, or in all cases, but not in some. I will try to find some time next week to debug step by step, but if you have any idea where to look, that would be very much appreciated, |
Ok I found the issue. |
A workaround would be to set data['monomers'] = data.smiles.apply(lambda s: pm.get_monomers(s, sort_by_mw=False)) |
Hi makers from m2p,
Hopefully you can help me with an error I don't understand. I want to polymerize random co-polyesters with a given distribution. In order to do that, I used smiles from their corresponding hydroxyacid monomers and a given distribution. Thus, I model these polymers by monomer 1=A-B and monomer 2=A-C, where A is the diol and B & C are the diacids. Strangely, this gives an error if the length of the diol A is the same for both monomers. See sample code below:
data = pd.DataFrame({'smiles':[
'OCOC(C1=CC=C(C(O)=O)C=C1)=O.OCCOC(C1=CC=CC(C(O)=O)=C1)=O', #works
'OCCOC(C1=CC=C(C(O)=O)C=C1)=O.OCCOC(C1=CC=CC(C(O)=O)=C1)=O', #ERROR:Ester_ReactionFailed
'OCCCOC(C1=CC=C(C(O)=O)C=C1)=O.OCCOC(C1=CC=CC(C(O)=O)=C1)=O', #works
'OCCCCOC(C1=CC=C(C(O)=O)C=C1)=O.OCCOC(C1=CC=CC(C(O)=O)=C1)=O' #works
],
'distribution':[[1,1],[1,1],[1,1],[1,1]]
})
data['monomers'] = data.smiles.apply(lambda s: pm.get_monomers(s))
data = pm.thermoplastic(data,DP=5,mechanism='ester',replicate_structures=1)
If I don't specify the distribution, it works fine. Do you have any idea where things go wrong?
Thank you for your response.
Kind regards,
Evelien
The text was updated successfully, but these errors were encountered: