-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vsearch and script for plotting quality files
- Loading branch information
Showing
3 changed files
with
110 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env Rscript | ||
suppressPackageStartupMessages(library(dada2)) | ||
suppressPackageStartupMessages(library(tidyverse)) | ||
suppressPackageStartupMessages(library(optparse)) | ||
|
||
option_list = list( | ||
make_option(c("-i","--id"), | ||
type="character", | ||
help="ID of sample"), | ||
make_option(c("-f", "--file_pattern"), | ||
type="character", | ||
default = "fastq.gz", | ||
help="File pattern [default \"%default\"]"), | ||
make_option(c("--session"), | ||
action = "store_true", | ||
help="Generate nf-core compliant YAML file w/ version information", | ||
), | ||
make_option(c("--yaml"), | ||
default = "versions.yml", | ||
help="YAML file name (see --session)") | ||
) | ||
|
||
opt <- parse_args(OptionParser(option_list=option_list)) | ||
|
||
fns <- list.files(pattern=opt$file_pattern, full.names=TRUE) | ||
|
||
pl <- plotQualityProfile(fns) | ||
ggsave(paste0(opt$id,".qualities.pdf"), plot=pl, device="pdf") | ||
|
||
# we may revisit the quality scores and other info in this plot for other purposes | ||
saveRDS(pl, paste0(opt$id,".qualities.RDS")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// TODO: at the moment I'm checking on the feasibility of using | ||
// these for additional QC plots, esp on cum expected errors; | ||
// at the moment they are a bit of a data dump | ||
|
||
process VSEARCH_EESTATS { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
container "quay.io/biocontainers/vsearch:2.27.0--h6a68c12_1" | ||
|
||
input: | ||
tuple val(meta), path(reads) | ||
|
||
output: | ||
path("${meta.id}.{R1,R2}.stats"), emit: stats | ||
path("${meta.id}.{R1,R2}.eestats"), emit: eestats | ||
path("${meta.id}.{R1,R2}.eestats2"), emit: eestats2 | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
if (meta.single_end) { | ||
""" | ||
vsearch --fastq_stats ${reads[0]} \ | ||
--log ${meta.id}.R1.stats | ||
vsearch --fastq_eestats ${reads[0]} \ | ||
--output ${meta.id}.R1.eestats | ||
vsearch --fastq_eestats2 ${reads[0]} \ | ||
--ee_cutoffs "0.5,1.0,2.0,4.0,8.0" \ | ||
--output ${meta.id}.R1.eestats2 | ||
""" | ||
} else { | ||
""" | ||
vsearch --fastq_stats ${reads[0]} \ | ||
--log ${meta.id}.R1.stats | ||
vsearch --fastq_stats ${reads[1]} \ | ||
--log ${meta.id}.R2.stats | ||
vsearch --fastq_eestats ${reads[0]} \ | ||
--output ${meta.id}.R1.eestats | ||
vsearch --fastq_eestats ${reads[1]} \ | ||
--output ${meta.id}.R2.eestats | ||
vsearch --fastq_eestats2 ${reads[0]} \ | ||
--ee_cutoffs "0.5,1.0,2.0,4.0,8.0" \ | ||
--output ${meta.id}.R1.eestats2 | ||
vsearch --fastq_eestats2 ${reads[1]} \ | ||
--ee_cutoffs "0.5,1.0,2.0,4.0,8.0" \ | ||
--output ${meta.id}.R2.eestats2 | ||
""" | ||
} | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.PDF | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters