kienerj / pycdxml

Tools to automatically convert and proccess cdx and cdxml files in python
GNU General Public License v3.0
35 stars 5 forks source link

Slide generation does not work with salts, only 1 fragment is choosen #1

Closed kienerj closed 2 years ago

kienerj commented 3 years ago

CDXMLSlideGenerator doesn't work with salts or any other "multi-fragment" chemical structure because currently CDXMLSlideGenerator just takes the first fragment in the file and adds that to the slide. A molecule inside ChemDraw is represented as a fragment object. So in a salt, there are at least 2 such fragments. If they are drawn by hand and not grouped, there is no way to know which fragments belong to each other. If you create a salt by Name2Structure, then it is grouped correctly.

Note: Grouping is currently also not taken into account.

Possible solutions:

Second option seems for usable for the real-world albeit "less correct". One could also imagine that all fragments in a file are taken as separate molecules and arranged in the grid accordingly. So for that one would have to rely on grouping again.

kienerj commented 2 years ago

Fixed by 25c45bb1b4aa4fe2851d31461411815190b3f3f5