From 6c471647c090a60757d111b781fd88e9e010715a Mon Sep 17 00:00:00 2001 From: "Filipe G. Vieira" Date: Tue, 16 Aug 2022 14:41:33 +0200 Subject: [PATCH] fix: create tabix index sub-wrapper (#501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Created index sub-wrapper * Fixed tests, paths, updated version, and added extra info Co-authored-by: Johannes Köster --- bio/tabix/{ => index}/environment.yaml | 2 +- bio/tabix/index/meta.yaml | 11 +++++++++++ bio/tabix/index/test/Snakefile | 12 ++++++++++++ bio/tabix/{ => index}/test/test.vcf.gz | Bin bio/tabix/{ => index}/wrapper.py | 0 bio/tabix/meta.yaml | 4 ---- bio/tabix/query/environment.yaml | 2 +- bio/tabix/query/meta.yaml | 6 ++++-- bio/tabix/query/test/Snakefile | 13 +++++++------ bio/tabix/test/Snakefile | 12 ------------ test.py | 4 ++-- 11 files changed, 38 insertions(+), 28 deletions(-) rename bio/tabix/{ => index}/environment.yaml (79%) create mode 100644 bio/tabix/index/meta.yaml create mode 100644 bio/tabix/index/test/Snakefile rename bio/tabix/{ => index}/test/test.vcf.gz (100%) rename bio/tabix/{ => index}/wrapper.py (100%) delete mode 100644 bio/tabix/meta.yaml delete mode 100644 bio/tabix/test/Snakefile diff --git a/bio/tabix/environment.yaml b/bio/tabix/index/environment.yaml similarity index 79% rename from bio/tabix/environment.yaml rename to bio/tabix/index/environment.yaml index 84c05153f5..d04d7c179f 100644 --- a/bio/tabix/environment.yaml +++ b/bio/tabix/index/environment.yaml @@ -3,4 +3,4 @@ channels: - bioconda - nodefaults dependencies: - - htslib ==1.10 + - htslib =1.15 diff --git a/bio/tabix/index/meta.yaml b/bio/tabix/index/meta.yaml new file mode 100644 index 0000000000..ed8af3049c --- /dev/null +++ b/bio/tabix/index/meta.yaml @@ -0,0 +1,11 @@ +name: tabix +description: Process given file with tabix (e.g., create index). +url: https://www.htslib.org/doc/tabix.html#INDEXING_OPTIONS +authors: + - Johannes Köster +input: + - Bgzip compressed file (e.g. BED.gz, GFF.gz, or VCF.gz) +output: + - Tabix index file +notes: | + * Specify tabix index params (e.g. `-p vcf`) through `params`. diff --git a/bio/tabix/index/test/Snakefile b/bio/tabix/index/test/Snakefile new file mode 100644 index 0000000000..dc17cf3f9c --- /dev/null +++ b/bio/tabix/index/test/Snakefile @@ -0,0 +1,12 @@ +rule tabix: + input: + "{prefix}.vcf.gz", + output: + "{prefix}.vcf.gz.tbi", + log: + "logs/tabix/{prefix}.log", + params: + # pass arguments to tabix (e.g. index a vcf) + "-p vcf", + wrapper: + "master/bio/tabix/index" diff --git a/bio/tabix/test/test.vcf.gz b/bio/tabix/index/test/test.vcf.gz similarity index 100% rename from bio/tabix/test/test.vcf.gz rename to bio/tabix/index/test/test.vcf.gz diff --git a/bio/tabix/wrapper.py b/bio/tabix/index/wrapper.py similarity index 100% rename from bio/tabix/wrapper.py rename to bio/tabix/index/wrapper.py diff --git a/bio/tabix/meta.yaml b/bio/tabix/meta.yaml deleted file mode 100644 index 2bd67c6dc9..0000000000 --- a/bio/tabix/meta.yaml +++ /dev/null @@ -1,4 +0,0 @@ -name: tabix -description: Process given file with tabix (e.g., create index). -authors: - - Johannes Köster diff --git a/bio/tabix/query/environment.yaml b/bio/tabix/query/environment.yaml index ac63b0d686..d04d7c179f 100644 --- a/bio/tabix/query/environment.yaml +++ b/bio/tabix/query/environment.yaml @@ -3,4 +3,4 @@ channels: - bioconda - nodefaults dependencies: - - htslib==1.12 + - htslib =1.15 diff --git a/bio/tabix/query/meta.yaml b/bio/tabix/query/meta.yaml index 48c276bab7..7c673f9351 100644 --- a/bio/tabix/query/meta.yaml +++ b/bio/tabix/query/meta.yaml @@ -1,11 +1,13 @@ name: tabix description: Query given file with tabix. -url: https://github.com/samtools/htslib +url: https://www.htslib.org/doc/tabix.html#QUERYING_AND_OTHER_OPTIONS authors: - William Rowell input: - Bgzip compressed file (e.g. BED.gz, GFF.gz, or VCF.gz) - Tabix index file - - Region of interest to retrieve (params.region) output: - Uncompressed subset of the input file from the given region +notes: | + * The `region` param (required) allows to specify region of interest to retrieve. + * The `extra` param allows for additional program arguments. diff --git a/bio/tabix/query/test/Snakefile b/bio/tabix/query/test/Snakefile index 665f1af61e..a6c54f534d 100644 --- a/bio/tabix/query/test/Snakefile +++ b/bio/tabix/query/test/Snakefile @@ -1,14 +1,15 @@ rule tabix: input: - "{prefix}.bed.gz", - "{prefix}.bed.gz.tbi" ## list the VCF/BCF as the first input ## and the index as the second input + "{prefix}.bed.gz", + "{prefix}.bed.gz.tbi", output: - "{prefix}.output.bed" - params: - region = "1" + "{prefix}.output.bed", log: - "logs/tabix/query/{prefix}.log" + "logs/tabix/query/{prefix}.log", + params: + region="1", + extra="", wrapper: "master/bio/tabix/query" diff --git a/bio/tabix/test/Snakefile b/bio/tabix/test/Snakefile deleted file mode 100644 index 1f58633f5e..0000000000 --- a/bio/tabix/test/Snakefile +++ /dev/null @@ -1,12 +0,0 @@ -rule tabix: - input: - "{prefix}.vcf.gz" - output: - "{prefix}.vcf.gz.tbi" - params: - # pass arguments to tabix (e.g. index a vcf) - "-p vcf" - log: - "logs/tabix/{prefix}.log" - wrapper: - "master/bio/tabix" diff --git a/test.py b/test.py index 674fb853d0..b865101867 100644 --- a/test.py +++ b/test.py @@ -3924,9 +3924,9 @@ def test_bismark_bismark2bedgraph(): @skip_if_not_modified -def test_tabix(): +def test_tabix_index(): run( - "bio/tabix", + "bio/tabix/index", ["snakemake", "--cores", "1", "--use-conda", "-F", "test.vcf.gz.tbi"], )