ASSEMBLY-STATS

Generates report of summary statistics for a genome assembly

URL:

Example

This wrapper can be used in the following way:

rule run_assembly_stats:
    input:
        #Input assembly
        assembly="{sample}.fasta",
    output:
        #Assembly statistics
        assembly_stats="{sample}_stats.txt",
    params:
        # Tab delimited output, with a header, is set as the default. Other options are available:
        #   -l <int>
        #       Minimum length cutoff for each sequence.
        #       Sequences shorter than the cutoff will be ignored [1]
        #   -s
        #       Print 'grep friendly' output
        #   -t
        #       Print tab-delimited output
        #   -u
        #       Print tab-delimited output with no header line
        # If you want to add multiple options just delimit them with a space.
        # Note that you can only pick one output format
        # Check https://github.com/sanger-pathogens/assembly-stats for more details
        extra="-t",
    log:
        "logs/{sample}.assembly-stats.log",
    threads: 1
    wrapper:
        "v1.1.0/bio/assembly-stats"

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

  • assembly-stats=1.0

Input/Output

Input:

  • Genomic assembly (fasta format)

Output:

  • Assembly statistics (format of your choosing, default = tab-delimited)

Notes

Authors

  • Pathogen Informatics, Wellcome Sanger Institute (assembly-stats tool) - https://github.com/sanger-pathogens
  • Max Cummins (Snakemake wrapper [unaffiliated with Wellcome Sanger Institute])

Code

__author__ = "Max Cummins"
__copyright__ = "Copyright 2021, Max Cummins"
__email__ = "max.l.cummins@gmail.com"
__license__ = "MIT"

from snakemake.shell import shell
from os import path

log = snakemake.log_fmt_shell(stdout=False, stderr=True)

shell(
    "assembly-stats"
    " {snakemake.params.extra}"
    " {snakemake.input.assembly}"
    " > {snakemake.output.assembly_stats}"
    " {log}"
)