PRETEXT MAP¶
Paired REad TEXTure Mapper. Converts SAM formatted read pairs into genome contact maps.
URL: https://github.com/wtsi-hpag/PretextMap
Example¶
This wrapper can be used in the following way:
rule pretext_map:
input:
"a.bam",
output:
"map.pretext",
log:
"logs/pretext_map.log",
params:
extra="--sortby length --sortorder descend --mapq 10",
wrapper:
"v1.15.0/bio/pretext/map"
Note that input, output and log file paths can be chosen freely.
When running with
snakemake --use-conda
the software dependencies will be automatically deployed into an isolated environment before execution.
Notes¶
- The extra param allows for additional arguments.
Software dependencies¶
pretextmap=0.1
samtools=1.15
snakemake-wrapper-utils=0.4
Authors¶
- Filipe G. Vieira
Code¶
__author__ = "Filipe G. Vieira"
__copyright__ = "Copyright 2022, Filipe G. Vieira"
__license__ = "MIT"
from snakemake.shell import shell
from snakemake_wrapper_utils.samtools import infer_out_format
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
extra = snakemake.params.get("extra", "")
if snakemake.input[0].endswith(".gz"):
pipe = "gunzip -c"
elif snakemake.input[0].endswith(".bz2"):
pipe = "bunzip2 -c"
elif infer_out_format(snakemake.input[0]) in ["SAM", "BAM", "CRAM"]:
pipe = "samtools view -h"
else:
pipe = "cat"
shell(
"({pipe}"
" {snakemake.input} | "
"PretextMap"
" {extra}"
" -o {snakemake.output}"
") {log}"
)