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
97 stars 27 forks source link

Template creation #451

Open mmongy opened 4 weeks ago

mmongy commented 4 weeks ago

Hi everyone,

I have just a question: is there a way to easily create your own templates and load them in DataHarmonizer? Or at least some documentation to explain what is the purpose of each file in a template directory?

Thanks by advance, Marc.

Edit: My bad, the bulk of the doc is here: https://github.com/cidgoh/DataHarmonizer/wiki/DataHarmonizer-Templates

Edit 2: However, is there a way to generate easily a basic schema.json template file?

ddooley commented 3 weeks ago

Hi, The web/templates/new/ is a barebones template, and if you are in that folder at the command prompt you can run:

python3 ../../../script/tabular_to_schema.py -m

and this will compile the given schema_core.yaml and schema_slots.tsv and schema_enums.tsv into schema.yaml and schema.json , the last of which DataHarmonizer actually users. The "-m" parameter then also adds the given schema to the DataHarmonizer menu system (via /web/templates/menu.js

Lastly, run yarn in root of DataHarmonizer github, and yarn dev to get local browser view, or yarn build:web to generate DH with schema/templates menu in the /web/dist/ folder.

Hope that helps!

ddooley commented 1 week ago

Any followup needed? BTW, in the spring we will be launching the ability of DataHarmonizer to edit and save its own template / schema files. This will vastly simplify this process!