diff --git a/bio/samtools/faidx/test/Snakefile b/bio/samtools/faidx/test/Snakefile index d15d6fba505..cf366a4235c 100644 --- a/bio/samtools/faidx/test/Snakefile +++ b/bio/samtools/faidx/test/Snakefile @@ -38,16 +38,31 @@ rule samtools_faidx_bgzip: "master/bio/samtools/faidx" -rule samtools_faidx_region: +rule samtools_faidx_region_file: input: "{sample}.fa", fai="idx/{sample}.fa.fai", + regions="{sample}.regions", output: - "out/{sample}.fas", + "out/{sample}.region_file.fas", log: - "{sample}.region.log", + "{sample}.region_file.log", params: - region="ref", + extra="--length 5", + wrapper: + "master/bio/samtools/faidx" + + +rule samtools_faidx_region_array: + input: + "{sample}.fa", + fai="idx/{sample}.fa.fai", + output: + "out/{sample}.region_array.fas", + log: + "{sample}.region_array.log", + params: + region=["ref", "ref2"], extra="--length 5", wrapper: "master/bio/samtools/faidx" @@ -59,9 +74,9 @@ rule samtools_faidx_bgzip_region: fai="idx/{sample}.fa.bgz.fai", gzi="idx/{sample}.fa.bgz.gzi", output: - "out/{sample}.bgz.fas", + "out/{sample}.region_bgzip.fas", log: - "{sample}.bgzip_region.log", + "{sample}.region_bgzip.log", params: region="ref", extra="--length 5", diff --git a/bio/samtools/faidx/test/genome.regions b/bio/samtools/faidx/test/genome.regions new file mode 100644 index 00000000000..6415016b862 --- /dev/null +++ b/bio/samtools/faidx/test/genome.regions @@ -0,0 +1 @@ +ref diff --git a/bio/samtools/faidx/wrapper.py b/bio/samtools/faidx/wrapper.py index 63e44abfa91..3a85b1e177c 100644 --- a/bio/samtools/faidx/wrapper.py +++ b/bio/samtools/faidx/wrapper.py @@ -17,10 +17,11 @@ # Get regions (if present) regions = snakemake.input.get("regions", "") if regions: - regions = f"--regions-file {regions}" + regions = f"--region-file {regions}" region = snakemake.params.get("region", "") + # Get FAI and GZI files if region or regions: fai = snakemake.input.get("fai", "") diff --git a/test.py b/test.py index 8ab245518f1..605462538c0 100644 --- a/test.py +++ b/test.py @@ -4242,8 +4242,9 @@ def test_samtools_faidx(): "out/genome.named.fa.fai", "out/genome.fas.bgz.fai", "out/genome.fas.bgz.gzi", - "out/genome.fas", - "out/genome.bgz.fas", + "out/genome.region_file.fas", + "out/genome.region_array.fas", + "out/genome.region_bgzip.fas", "--use-conda", "-F", ],