.. _`bio/dada2/quality-profile`: DADA2_QUALITY_PROFILES ====================== .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/dada2/quality-profile?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/dada2/quality-profile `DADA2 `_ Plotting the quality profile of reads using dada2 ``plotQualityProfile`` function. The function is introduced in the dedicated tutorial `section `_. Example ------- This wrapper can be used in the following way: .. code-block:: python rule dada2_quality_profile_se: input: # FASTQ file without primers sequences "trimmed/{sample}.{orientation}.fastq" output: "reports/dada2/quality-profile/{sample}.{orientation}-quality-profile.png" log: "logs/dada2/quality-profile/{sample}.{orientation}-quality-profile-se.log" wrapper: "v3.0.4/bio/dada2/quality-profile" rule dada2_quality_profile_pe: input: # FASTQ file without primers sequences expand("trimmed/{{sample}}.{orientation}.fastq",orientation=[1,2]) output: "reports/dada2/quality-profile/{sample}-quality-profile.png" log: "logs/dada2/quality-profile/{sample}-quality-profile-pe.log" wrapper: "v3.0.4/bio/dada2/quality-profile" 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 --------------------- * ``bioconductor-dada2=1.28.0`` Input/Output ------------ **Input:** * a FASTQ file (potentially compressed) without primers sequences **Output:** * A PNG file of the quality plot Authors ------- * Charlie Pauvert Code ---- .. code-block:: R # __author__ = "Charlie Pauvert" # __copyright__ = "Copyright 2020, Charlie Pauvert" # __email__ = "cpauvert@protonmail.com" # __license__ = "MIT" # Snakemake wrapper for plotting the quality profile of reads using dada2 plotQualityProfile function. # Sink the stderr and stdout to the snakemake log file # https://stackoverflow.com/a/48173272 log.file<-file(snakemake@log[[1]],open="wt") sink(log.file) sink(log.file,type="message") library(dada2) # Plot the quality profile for a given FASTQ file or a list of files pquality<-plotQualityProfile(unlist(snakemake@input)) # Write the plots to files library(ggplot2) ggsave(snakemake@output[[1]], pquality, width = 4, height = 3, dpi = 300) # Proper syntax to close the connection for the log file # but could be optional for Snakemake wrapper sink(type="message") sink() .. |nl| raw:: html