Horizontal scrolling omits cell borders

Hi team,

The latest version of Datagrok, which now seems to persist the RDKit-based structure rendering on horizontal scrolling (Thanks @dskatov), is now omitting the cell borders:

It seems like it’s even omitting the column headers at certain scroll positions and flickering when scrolling fast.

Hi @nico.pulver.novartis.com, thanks for reporting the issue! It may have to with the way we round the coordinates for the RDKit input, indeed, let’s check this up together today with your reproduction.

The flickering issue is definitely there (this is due to the RDKit renderer currently being a lot slower than OpenChemLib’s - there are ways to alleviate that by caching constructed molecules and/or rendered images, but first we want to find out the bottleneck and hopefully fix the root of the issue).

We have not seen the disappearing borders yet - I wonder if you experience the same issue on our dev instance? What’s your environment?

The flickering occurred on the column headers, not the structure depiction.
What information about the environment do you want me to share?

Browser version, OS, system font magnification settings, browser zoom level. Oh, and are borders completely gone, not just around molecules, but work fine on datasets without the molecules? Is the rest of the content missing as well or you cleaned it? Can’t tell from your picture for sure since it’s “anonymized”. If this is the case I have an idea, Is there anything in the console? Indeed let’s see it in person later today.

Hey @nico.pulver.novartis.com, we’ve discovered what may be happening out there. Following the screenshot, you are doing an R-group analysis. Are your smiles there recorded as something like “[R1]=NNC(=O)COc1cccc2ccccc12”? If so, it turns out WASM RdKit doesn’t handle such input with the R-group index, thus producing an internal exception and in the course of this exception occurring — corrupting the rendered grid. Please let me know what kind of stuff you have there in R1 and R2 columns. Then I’d find a strategy to deal with this. Thanks!

Hi Dan
The R group decomposition is performed outside of Datagrok and the results are directly written with the rest of the data to the dataframe.
The R group decomposition is done using RDKit and produces following notation:
Which is of course working fine with RDKit and also renders just fine.

The question is really if the issue I reported above is still occurring with the latest Datagrok and Chem package version. Let’s do more testing and see if I can reproduce this at all again.

It seems like we are still facing this issue with the latest version of Datagrok and Chem package, you deployed last week:

We also see a couple of unhandled exceptions in the console.

Hey Nico, thanks for the report! The exception is exactly the RDKit’s exception, which appears presumably for the case where the RDKit molecule is constructed from a smiles (or other notation such as MolBlock) which it doesn’t properly handle. One example is a notation such as “[R1]…”, with R-group index in such form with the brackets in the beginning of the smiles record. Another case which we met is an empty line before or after the MolBlock text, where RDKit crashes too.

Please let us know what there is and we’d manage to handle it in some way, or address this via RDKit. It may turn out so that not all “full RDKit” capabilities for parsing molecule inputs are supported in WASM RDKit (MinimalLib). Though I can’t be 100% certain about it until we see more samples to reproduce.

Hi Dan, the MinimalLib supports the same SMILES and MDL block parsing capabilities as the C++ RDKit library.
The RDKit will not parse things like

RDKit ERROR: [14:38:50] SMILES Parse Error: syntax error while parsing: [R1]CCCC
RDKit ERROR: [14:38:52] SMILES Parse Error: Failed parsing SMILES ‘[R1]CCCC’ for input: ‘[R1]CCCC’

as well as MolBlocks preceded by an empty line:

assert(Chem.MolFromMolBlock("\n" + Chem.MolToMolBlock(Chem.MolFromSmiles(“CCC”))))
RDKit WARNING: [14:43:17] Counts line too short: ‘’ on line4


But it will accept MolBlocks followed by an empty line:

assert(Chem.MolFromMolBlock(Chem.MolToMolBlock(Chem.MolFromSmiles(“CCC”)) + “\n”))

However the SMILES that Nico used doesn’t have any [R#] notation.

1 Like