qcscine / molassembler

Chemoinformatics toolkit with support for inorganic molecules
https://scine.ethz.ch/download/molassembler
BSD 3-Clause "New" or "Revised" License
31 stars 7 forks source link

ZeroAssignmentStereopermutators Error for unclear reason #9

Closed ViktoriiaBaib closed 1 year ago

ViktoriiaBaib commented 1 year ago

I am using Python Molassembler in Google CoLab to operate with graphs and generate 3d representations. The molecule I am working with is Bi-ion surrounded by ligands. I have built a graph and obtained 3d structures with dg.generate_ensemble (image 1):

Screen Shot 2023-01-25 at 11 18 46 AM

Then I remove one of the ligands and try to generate 3d structures again, but this time I get Error.ZeroAssignmentStereopermutators (image 2):

Screen Shot 2023-01-25 at 11 22 11 AM

This seems not very reasonable to me. Could you check that it works how it supposed to be?

nabbelbabbel commented 1 year ago

Thanks for reporting the issue.

Could you please provide the inputs/scripts such that I can try to reproduce your exact error.

ViktoriiaBaib commented 1 year ago

Sure!

I attach archive with python notebook for running in CoLab and XYZ files which I use.

Archive.zip

Thank you!

nabbelbabbel commented 1 year ago

Thanks for the files. I can confirm this is also an issue on our side (with a release candidate for the next version). We will have a look at it.

moritzBens commented 1 year ago

Hi Viktoriia, I went through your example and figured out what is happening. After you remove the first water ligand

scine_molecules = editing.cleave(bino3, BondIndex(0, 4))
fragment = scine_molecules[0]

you have a shape at Bi with seven vertices of which three pairs are linked through nitrogen atoms. There are three different shapes implemented with seven vertices (pentagonal bipyramid, capped octahedron, capped trigonal prism). Molassembler selects the pentagonal bipyramid as the shape because it does not see any reason to select one of the less symmetric ones (and it does not matter here. The result is always the same, independent of the shape). Then molassembler tries to figure out how it can place the ligands on the shape's vertices under the condition that all cycles between the ligands are possible, i.e., it checks if it can realize the -O-N-O- links that are connected to Bi, assuming bond lengths between the atoms derived from the sum of the UFF atomic radii and the angles in the polyhedron. The atomic radii are r_O = 0.658, r_N = 0.7, and r_Bi = 1.512. Now the problem is, that this check finds no possible ligand arrangement (you cannot avoid placing at least one link between an axial and an equatorial shape position): pentagonal_bipyramid

In your case, you add an eight ligand before generating the first conformers, which then works. However, as soon as you remove the second water ligand, you are back to the pentagonal bipyramid, and the ligand arrangement is impossible.

You can check if a molecule is actually realizable by calling fragment.stereopermutators.has_zero_assignment_permutators().

If you are really sure about these conformers, consider changing the Bi radius.

ViktoriiaBaib commented 1 year ago

Thank you for the explanation!