.. _`bio/fgbio/callmolecularconsensusreads`: FGBIO CALLMOLECULARCONSENSUSREADS ================================= .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/fgbio/callmolecularconsensusreads?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/fgbio/callmolecularconsensusreads Calls consensus sequences from reads with the same unique molecular tag. Example ------- This wrapper can be used in the following way: .. code-block:: python rule ConsensusReads: input: "mapped/a.bam" output: "mapped/{sample}.m3.bam" params: extra="-M 3" log: "logs/fgbio/consensus_reads/{sample}.log" wrapper: "v3.0.4/bio/fgbio/callmolecularconsensusreads" Note that input, output and log file paths can be chosen freely. When running with .. code-block:: bash snakemake --use-conda the software dependencies will be automatically deployed into an isolated environment before execution. Software dependencies --------------------- * ``fgbio=2.1.0`` Authors ------- * Patrik Smeds Code ---- .. code-block:: python __author__ = "Patrik Smeds" __copyright__ = "Copyright 2018, Patrik Smeds" __email__ = "patrik.smeds@gmail.com" __license__ = "MIT" from snakemake.shell import shell shell.executable("bash") log = snakemake.log_fmt_shell(stdout=False, stderr=True) extra_params = snakemake.params.get("extra", "") bam_input = snakemake.input[0] if not isinstance(bam_input, str) and len(snakemake.input) != 1: raise ValueError("Input bam should be one bam file: " + str(bam_input) + "!") output_file = snakemake.output[0] if not isinstance(output_file, str) and len(snakemake.output) != 1: raise ValueError("Output should be one bam file: " + str(output_file) + "!") shell( "fgbio CallMolecularConsensusReads" " -i {bam_input}" " -o {output_file}" " {extra_params}" " {log}" ) .. |nl| raw:: html