Skip to content

Commit

Permalink
feat: add datavzrd wrapper (#535)
Browse files Browse the repository at this point in the history
* initial datavzrd wrapper

* Update utils/datavzrd/meta.yaml

Co-authored-by: Filipe G. Vieira <fgarrettvieira@gmail.com>

* Update Snakefile

* Update meta.yaml

* Update meta.yaml

* Update utils/datavzrd/test/Snakefile

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>

* Update utils/datavzrd/test/Snakefile

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>

* Update utils/datavzrd/meta.yaml

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>

* Update utils/datavzrd/environment.yaml

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>

Co-authored-by: Filipe G. Vieira <fgarrettvieira@gmail.com>
Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
  • Loading branch information
3 people committed Aug 18, 2022
1 parent 8c4d1cb commit 8c05064
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/datavzrd/environment.yaml
@@ -0,0 +1,5 @@
channels:
- conda-forge
- nodefaults
dependencies:
- datavzrd =1.17
10 changes: 10 additions & 0 deletions utils/datavzrd/meta.yaml
@@ -0,0 +1,10 @@
name: datavzrd
description: |
datavzrd allows to render tables by providing a configuration file.
Configuration templates can be dynamically customized by utilizing the
`rendering integration <https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#template-rendering-integration>`_.
Any files specified in the configuration file have to be also specified as additional input files in the
datavzrd rule.
url: https://github.com/koesterlab/datavzrd
authors:
- Felix Mölder
21 changes: 21 additions & 0 deletions utils/datavzrd/test/Snakefile
@@ -0,0 +1,21 @@
rule all: # [hide]
input: # [hide]
"results/datavzrd-report/A", # [hide]


rule datavzrd:
input:
config="resources/{sample}.datavzrd.yaml",
# optional files required for rendering the given config
table="data/A.tsv",
output:
report(
directory("results/datavzrd-report/{sample}"),
htmlindex="index.html",
# see https://snakemake.readthedocs.io/en/stable/snakefiles/reporting.html
# for additional options like caption, categories and labels
),
log:
"logs/datavzrd_report/{sample}.log",
wrapper:
"master/utils/datavzrd"
3 changes: 3 additions & 0 deletions utils/datavzrd/test/data/A.tsv
@@ -0,0 +1,3 @@
symbol gene feature impact hgvsp
PTEN ENSG00000171862 ENST00000371953 HIGH ENSP00000361021.3:p.Arg335Ter
FGFR ENSG00000145675 ENST00000521381 HIGH ENSP00000428056.1:p.Tyr580Ter
12 changes: 12 additions & 0 deletions utils/datavzrd/test/resources/A.datavzrd.yaml
@@ -0,0 +1,12 @@
name: My variant report
datasets:
variants:
path: "data/A.tsv"
separator: "\t"

default-view: variants
views:
variants:
dataset: variants
desc: |
### Some crazy variants
10 changes: 10 additions & 0 deletions utils/datavzrd/wrapper.py
@@ -0,0 +1,10 @@
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2017, Johannes Köster"
__email__ = "johannes.koester@protonmail.com"
__license__ = "MIT"

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

shell("datavzrd {snakemake.input.config} --output {snakemake.output[0]} {log}")

0 comments on commit 8c05064

Please sign in to comment.