Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added wrapper for using tabix to query an indexed file (#203)
* added wrapper for using tabix to query an indexed file * updated htslib version and added test
- Loading branch information
1 parent
599f370
commit 2bb9131
Showing
7 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
channels: | ||
- bioconda | ||
- conda-forge | ||
dependencies: | ||
- htslib==1.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: tabix | ||
description: Query given file with tabix. | ||
url: https://github.com/samtools/htslib | ||
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 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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 | ||
output: | ||
"{prefix}.output.bed" | ||
params: | ||
region = "1" | ||
log: | ||
"logs/tabix/query/{prefix}.log" | ||
wrapper: | ||
"master/bio/tabix/query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
__author__ = "William Rowell" | ||
__copyright__ = "Copyright 2020, William Rowell" | ||
__email__ = "wrowell@pacb.com" | ||
__license__ = "MIT" | ||
|
||
from snakemake.shell import shell | ||
|
||
extra = snakemake.params.get("extra", "") | ||
log = snakemake.log_fmt_shell(stdout=False, stderr=True) | ||
|
||
shell( | ||
"tabix {extra} {snakemake.input[0]} {snakemake.params.region} > {snakemake.output} {log}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters