RBT COLLAPSE-READS-TO-FRAGMENTS BAM
Calculate consensus reads from read groups marked by PicardTools MarkDuplicates or UmiAwareMarkDuplicatesWithMateCigar.
URL: https://github.com/rust-bio/rust-bio-tools
Example
This wrapper can be used in the following way:
rule calc_consensus_reads:
input:
"mapped/{sample}.marked.bam",
output:
consensus_r1="results/consensus/{sample}.1.fq",
consensus_r2="results/consensus/{sample}.2.fq",
consensus_se="results/consensus/{sample}.se.fq",
skipped="results/consensus/{sample}.skipped.bam",
params:
extra="--annotate-record-ids",
log:
"logs/consensus/{sample}.log",
wrapper:
"v3.9.0-1-gc294552/bio/rbt/collapse_reads_to_fragments-bam"
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.
Software dependencies
rust-bio-tools=0.42.2
Code
__author__ = "Felix Mölder"
__copyright__ = "Copyright 2022, Felix Mölder"
__email__ = "felix.moelder@uk-essen.de"
__license__ = "MIT"
from snakemake.shell import shell
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
extra = snakemake.params.get("extra", "")
shell(
"rbt collapse-reads-to-fragments bam {extra} {snakemake.input[0]} {snakemake.output} {log}"
)