diff --git a/prjcfg.yaml b/prjcfg.yaml new file mode 100644 index 0000000..d0aace4 --- /dev/null +++ b/prjcfg.yaml @@ -0,0 +1,5 @@ +metadata: + sample_table: samples.tsv + subsample_table: units.tsv + +snake_config: "config.yaml" diff --git a/rules/common.smk b/rules/common.smk index f6b9635..73bf0ac 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -1,17 +1,19 @@ import pandas as pd +from peppy import SnakeProject from snakemake.utils import validate -report: "../report/workflow.rst" ###### Config file and sample sheets ##### -configfile: "config.yaml" +p = SnakeProject("prjcfg_native.yaml") +configfile: p.snake_config validate(config, schema="../schemas/config.schema.yaml") -samples = pd.read_table(config["samples"]).set_index("sample", drop=False) +samples = p.sample_table + validate(samples, schema="../schemas/samples.schema.yaml") -units = pd.read_table(config["units"], dtype=str).set_index(["sample", "unit"], drop=False) -units.index = units.index.set_levels([i.astype(str) for i in units.index.levels]) # enforce str in index +units = p.subsample_table + validate(units, schema="../schemas/units.schema.yaml") # contigs in reference genome diff --git a/units_peppy.tsv b/units_peppy.tsv new file mode 100644 index 0000000..57eaf1e --- /dev/null +++ b/units_peppy.tsv @@ -0,0 +1,4 @@ +sample_name platform fq1 fq2 +A ILLUMINA data/reads/a.chr21.1.fq data/reads/a.chr21.2.fq +B ILLUMINA data/reads/b.chr21.1.fq data/reads/b.chr21.2.fq +B ILLUMINA data/reads/b.chr21.1.fq