cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 25 forks source link

In LinkML branch: determine section membership with slot group #276

Closed turbomam closed 2 years ago

turbomam commented 2 years ago

preferably as an option, in addition to the current use of is_a parents

slot_group definition

Sujay and I will work on this

This is probably the entry point in main_linkml.js

turbomam commented 2 years ago

Also to do: order the columns by rank

how are they ordered now @ddooley ? By order of appearance in schema.js?

turbomam commented 2 years ago

bump: the linkml datastructure branch does group according to slot_groups now :-) , but it doesn't yet order either sections or columns according to rank.

@sujaypatil96 , you can help with this, right? :-)

ddooley commented 2 years ago

Ordering of DH columns is now by rank on both server side (via linkml.py) and browser side (via script/dataharmonizer/index.js).

turbomam commented 2 years ago

I think the slot_groups have ranks as well. I'll dig something up now.

ddooley commented 2 years ago

As noted on Slack, I missed that “dh_section” is a slot, and under that we have various slot “sub-class” entities, which are referenced by slots’ “slot_group” field. I’ll revise section sorting code to take that into account now.

turbomam commented 2 years ago

The slot analysis_type appears in every enviroment-based template with the title "analysis/data type"

It should appear in column 1 of the sample_id section, which has the title "Sample ID".

I think that's all fine in the linkml-datastructure branch now.

Additionally, sample_id has rank = 1, so it should be the first section

I should implement something that ensures that ranks aren't re-used (like multiple sections with rank = 1)

analysis_type:
  name: analysis_type
  rank: 1
  description: Select all the data types associated or available for this biosample
  title: analysis/data type
  examples:
  - value: metagenomics; metabolomics; proteomics
  see_also:
  - MIxS:investigation_type
  multivalued: true
  slot_group: sample_id
  range: analysis_type_enum
  required: true

sample_id:
  name: sample_id
  rank: 1
  title: Sample ID
  from_schema: https://example.com/nmdc_dh
  is_a: dh_section
ddooley commented 2 years ago

The latest push should fix this. For sort, I just had to add a call to fetch slot_group specs from overall specification in order to get rank.

turbomam commented 2 years ago

Yes, section and column layout looks great now.

Did you say you thought that column jumping would be restored in this push? I tried once in my usual setup and it didn't work for me yet.

turbomam commented 2 years ago

Show section isn't working under my use conditions in Chrome, either.

I have seen the jump and show functionality working in FF, but I have also been able to break it by loading data and validating

ddooley commented 2 years ago

There's some odd behaviour with slots that are a subclass of one section but have "slot_group" some other section. Fields in "MIxS core" seems to be problematic this way re. show section, and jumping to them. Looking into it.

turbomam commented 2 years ago

There's some odd behaviour with slots that are a subclass of one section but have "slot_group" some other section

Oh! I don't I intended that to happen. I will look into that later today.

ddooley commented 2 years ago

Not your problem. It turns out menu wasn't refreshing list of template sections or jump to fields. Fixed but have to fix something else before pushing commit on that.

ddooley commented 2 years ago

This should be fixed with latest commit. I didn't catch it earlier because I wasn't doing template change when testing the show/jump functionality.

turbomam commented 2 years ago

Show/jump operations work in Chrome and Firefox

ddooley commented 2 years ago

K. likely validation causing javascript error that is knocking out other js functions. I will test on your sample data.

turbomam commented 2 years ago

I think this is done. @sujaypatil96 may have some ideas for removing some section arrangement functionality that's replicated between the python can javascript components, but that could be another issue.