Closed Polo-Zecc closed 1 year ago
Hi, thank you. I'll try to review your code on Monday.
I understand your issue. Please edit the file using the Github "edit" button (a pencil). Or use this link. https://github.com/Pymol-Scripts/Pymol-script-repo/edit/master/plugins/optimize.py
If you can't please upload the modified file.
Ping @Polo-Zecc , whats up?
Have forked it and opened a pull request for edited code
Merged from #117
Optimize plugin gives and takes the data to and from OpenBabel as a PDB file, which for small molecules doesn't work very will due to bonding information not being taken into account well - eg for a nucleotide the output was dearomatized, for a short oligopeptide a tyrosine had been split into a phenylalanine and water molecule and an arginine lost its guanidine as ammonia and a carbodiimide.
This is fixable by changing the input/output file type to MOL: Line 250 -> mol_string = cmd.get_str('mol',selection) 253 -> obconversion.SetInAndOutFormats('mol', 'mol') 255 -> obconversion.ReadString(mol, mol_string) 256 -> removed 269 -> mol_string = obconversion.WriteString(mol) 273 -> cmd.read_molstr(mol_string, name,state=0,finish=1,discrete=1) 280 -> mol_string = cmd.get_str('mol',selection) 283 -> obconversion.SetInAndOutFormats('mol', 'mol') 285 -> obconversion.ReadString(mol, mol_string) 286 -> removed 320 -> mol_string = obconversion.WriteString(mol) 321 -> cmd.read_molstr(mol_string, name_n,state=0,finish=1,discrete=1) 329 -> mol_string = obconversion.WriteString(mol) 331 -> cmd.read_molstr(mol_string, name,state=0,finish=1,discrete=1)
I am very inexperienced with coding so this may not be formatted particularly clearly, and may not be the optimal way of fixing this, but seems to work for me thus far.