SiMolecule / centres

Perception and labelling of stereogenic centres in chemical structures
BSD 2-Clause "Simplified" License
16 stars 3 forks source link

Inconsistent pseudoasymmetric state on Rule 6 center #8

Closed iclkevin closed 1 year ago

iclkevin commented 1 year ago

When verifying the CENTRES code against the validation suite, I am able to match everything except the center spiro configurations for structures VS294 and VS295. The spiro center will always be assigned the correct parity, but the psuedoasymmetric state is not consistent. This depends on the order of bonds requested by the BaseMol.getBonds(final Atom atom) function. If the order of the bonds in this function is identical to the input order from the SD file, I am able to get the correct pseudoasymmetric state for an unlimited number of iterations in a row. But if I shuffle the Iterable before it is returned by the getBonds(Atom) function, I will always get the meso result within 10 iterations.

Please let me know if I can provide any further information.

johnmay commented 1 year ago

Confirmed, you see this go between R and r right and not R and S?

iclkevin commented 1 year ago

Correct, VS294 switches from R to r and VS295 switches from S to s.

johnmay commented 1 year ago

I think it's a simple tweak/quirk of the rule 6 interacting with when something is considered psuedo-asymmetric or not. My view somewhat is the R/s S/s is a bit redundant for example many name-to-structure just ignore the casing anyways.

e.g. (R,R)-1,4-dihydroxycyclohexane in ChemDraw works fine.

Nevertheless it should be consistent.

johnmay commented 1 year ago

I need to think a bit more but I think simple fix is Rule6 should return -2/+2 rather than -1/+1. This is used to indicate if something is pseudo-asymmetric, since Rule6 is after Rule5 you must be equivalent pseudo/asymmetric up to that point.

johnmay commented 1 year ago

Thanks Kevin, good find and an omission/oversight on my part. Thankfully a simple fix.

iclkevin commented 1 year ago

Thank you, John. This is very impressive work. I have one more inconsistency issue found, a minor issue, I am just putting together a test case and will open up another ticket.

johnmay commented 1 year ago

Perfect thanks.