ndcn / omicser

The NDCN omics browser app for browsing and sharing general omics data.
https://ndcn.github.io/omicser
Other
3 stars 3 forks source link

Feature metadata tables not loading #155

Open bnovotny opened 2 years ago

bnovotny commented 2 years ago

Describe the bug Tables for feature metadata on both the "Playground/Table" tab and the "Data Table/Feature Meta" tab perpetually display "Processing..." and never load.

To Reproduce Steps to reproduce the behavior:

  1. Launch omicser
  2. Load data on "Ingest" tab
  3. Go to "Playground" tab, click on "Data Table"
  4. Go to "Data Table" tab, click on "Feature Meta"

Expected behavior Table with feature metadata from "var_annot" should display.

Screenshots image

image

Desktop (please complete the following information):

Additional context Could be a format rendering issue in datatable, however I don't think it's a problem with attempting to format PubChem IDs (numeric IDs that need to be displayed as character in the table), because the issue persists when I remove the PubChem ID column in my data frame.

ricoderks commented 2 years ago

I have 3 example datasets:

Only for the latter 2 I get warnings in R that the output will contain list-cols. I'll look deeper in to this.

ricoderks commented 2 years ago

Getting rid of the list-cols didn't solve the problem.

@bnovotny can you send me your database in a zip file? I don't have a dataset where the feature meta table is not working in the data table tab.

@ergonyc I tracked the problem down to this piece of code:

render_num_js = JS(
        "function(data, type, row, meta){",
        "return type === 'display' ?",
        "data.toExponential(2) : data;",
        "}")

This piece of javascript is causing the data.table to hang on processing. If I leave this out of columnDefs the table renders nicely. Looking further I found there are NA's in one column. My javascript skills are limited to reading javascript. Haven't figured out yet how to fix this function.

This didn't work.

render_num_js = JS(
        "function(data, type, row, meta){",
        "return type === 'display' && !isNaN(data) ?",
        "data.toExponential(2) : data;",
        "}")
ricoderks commented 2 years ago

PR #165 should fix this problem. The reason why I didn't see the issue in the data table tab is that I was only showing the first 25 rows and the first NA appears later.

bnovotny commented 2 years ago

Thanks! I can't send my database but I will try it with the changes you implemented.

ergonyc commented 2 years ago

I'm going to leave this open for now and see what kind of crazy tables might get rendered and if the JavaScript is robust.

Great work @bnovotny @ricoderks !!