cbouy / mols2grid

Interactive molecule viewer for 2D structures

Home Page:https://mols2grid.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Searching CAS numbers

aarontj73 opened this issue · comments

Hello,

I have a dataframe with two columns, 'SMILES', and 'CAS', with both containing their obvious entities. One issue I am having is that the search tool, when 'text' searching for CAS number, doesn't seem to work with the built in dashes in CAS numbers, (e.g., 50-00-0). For example, if I were to start typing in '50' it would find all the text with '50' somewhere in it, but as soon as i type '50-' it doesn't find anything.

Obviously I could just remove all the dashes from the CAS numbers and just instruct users of my app to do the same, but I'd like to keep the original number present if possible.

I'm surprised this issue hasn't come up before. Any suggestions?

It's a known problem in the underlying library that I use to create the paginated grid, but there hasn't been any answer from the maintainer of the lib in a while now.
Basically if you have a regex character ([-[\]{}()*+?.,\\^$|#) in your search it will fail.

I'll see if I can somehow patch it, but apart from removing the dashes as you suggested I don't see any other quick workaround at the moment...