statgen / pheweb

A tool to build a website to browse hundreds or thousands of GWAS.
MIT License
158 stars 65 forks source link

Autogenerate tables and definition lists #88

Open pjvandehaar opened 7 years ago

pjvandehaar commented 7 years ago

autogenerate table columns

(see also https://github.com/statgen/pheweb/issues/21 https://github.com/statgen/pheweb/issues/42)

for [Manhattan, regionLZ, geneLZ/bottom], linking to gene pages will require phenocode, which must be passed in somehow.

Strategy:

  1. start with conf.parse.fields[].table_underscoretemplate and conf.parse.template_only_fields[].table_underscoretemplate
  2. fill in defaults
    • each entry must end up with head_template, cell_template, inclusion_criteria (just a disjunctive list of fields?).
  3. pass to js via model.table_underscoretemplate
  4. at render time, check which columns to include, render the table header into the page, and pass the row template to streamtable.
    • every page must receive all 3: per-variant, per-assoc, and per-pheno.
      • Manhattan & LZ will store per-pheno at model.const
      • PheWAS will store per-variant at model.const
      • var wrappedtemplater = obj => templater(deepcopy(obj).update(model.const))
    • also, somehow pass color_by_category to the table template on pages that have categories (ie, PheWAS and tophits)?
    • figure out ordering, hiding at various screensizes, and hiding nearest_gene on geneLZ.

autogenerate definition lists

These are just <p>s, so just use templates like .tooltip_underscoretemplate.

Just feed in model.const.