-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Incorrect bond perception from 3D #1808
Comments
I see your point, but I haven't had many people clamoring to see trivalent O+ species. The problem with the bond perception code is that it has to serve many masters - the most frequent being people reading PDB or CIF files, where there's atomic disorder. So right now, the code restricts some elements to a maximum valence (2 for oxygen) and drop the longest bond - here the C-O. My guess is that increasing valence to 3 for oxygen is going to have far more problems outside your use case. Your profile mentions MD - my strong suggestion is to either write your own bond perception code (for single bonds it's pretty easy) or track the bond topology through the MD. |
I appreciate your fast reply. As far as writing my own bond perception code, I track bonds using distance cutoffs during simulation and from there I build contact matrices. So I essentially know what the topology of each molecule is, but I still preferred to use SMILES strings as there are many tools for visualization. Do you know if it is possible for me to instead somehow pass my system's contact matrix to openbabel and have it generate the SMILES string? Or am I simply better off building my own visualization tools for my tracked contact matrices? Thank you for the help! |
No, no need to build your own tools. That's the whole point of Open Babel and Avogadro. There are a few options, but the easiest is probably to read in the XYZ file, delete all the bonds, and then create them as needed with mol.OBMol.AddBond(beginIndex, endIndex, bondOrder) Keep in mind that to delete the bonds, you'll want to iterate through them, add to a list and then delete them through the list:
|
Environment Information
Open Babel version: 2.4.1 (installed using
conda install -c openbabel openbabel
)Operating system and version: MacOS 10.12.6
Expected Behavior
Expected SMILES string:
[Li]OC(=O)OCC[O+]1CCOC1=O
Actual Behavior
Generated SMILES string:
[Li]OC(=O)OC[CH2].C1(=O)OCCO1
Steps to Reproduce
After copying the structure information into
structure.xyz
, the following code should reproduce the bug.XYZ file contents:
The text was updated successfully, but these errors were encountered: