Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature metadata tables not loading #155

Open
bnovotny opened this issue Jan 13, 2022 · 5 comments
Open

Feature metadata tables not loading #155

bnovotny opened this issue Jan 13, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@bnovotny
Copy link

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):

  • OS: Windows 10
  • Browser: Chrome

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
Copy link
Collaborator

I have 3 example datasets:

  • data from domenico: shows both tables
  • data from lipidyzer: shows only feature meta table in data table tab
  • data from lipidyzer: shows only feature meta table in data table tab

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
Copy link
Collaborator

ricoderks commented Jan 17, 2022

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
Copy link
Collaborator

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
Copy link
Author

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

@ergonyc
Copy link
Member

ergonyc commented Jan 19, 2022

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 !!

@ergonyc ergonyc added the bug Something isn't working label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants