luslab-umitools | Cleanup for submission

This commit is contained in:
Chris Cheshire 2020-06-19 15:55:45 +01:00
parent 961d12275a
commit 58d345fe81
4 changed files with 18 additions and 29 deletions

View file

@ -2,10 +2,6 @@
# conda env create -f environment.yml # conda env create -f environment.yml
name: nfcore-module-umitools name: nfcore-module-umitools
channels: channels:
- conda-forge
- bioconda - bioconda
- defaults
dependencies: dependencies:
## bioconda packages, see above
- umi_tools=1.0.1 - umi_tools=1.0.1

View file

@ -23,28 +23,25 @@ process umitools_dedup {
shell: shell:
// Init // Init
error_message = "" internal_prog = "umi_tools dedup"
args_exist = "false" internal_args = "--log=${sample_id}.dedup.log"
internal_prog = "umi_tools dedup "
internal_args = ""
// Check main args string exists and strip whitespace // Check main args string exists and strip whitespace
if(params.umitools_dedup_args) { if(params.umitools_dedup_args) {
internal_args = params.umitools_dedup_args ext_args = params.umitools_dedup_args
internal_args = internal_args.trim() + " --log=${sample_id}.dedup.log " internal_args += " " + ext_args.trim()
args_exist = "true"
} }
else {
error_message = "params.umitools_dedup_args does not exist, please define to run this module." // Contruct CL line
internal_cl = "${internal_prog} ${internal_args} -I $bam -S ${sample_id}.dedup.bam --output-stats=${sample_id}"
// Log
if (params.verbose){
println ("[MODULE] umi_tools/dedup exec: " + internal_cl)
} }
//SHELL //SHELL
""" """
if ${args_exist}; then ${internal_cl}
${internal_prog}${internal_args}-I $bam -S ${sample_id}.dedup.bam --output-stats=${sample_id}
else
echo "${error_message}" 1>&2
exit 1
fi
""" """
} }

View file

@ -60,11 +60,6 @@ Channel
--------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------*/
workflow { workflow {
// Logging
if (params.verbose){
println ("[MODULE] umi_tools/dedup ARGS: " + params.umitools_dedup_args)
}
// Run dedup // Run dedup
umitools_dedup ( ch_test_meta_bambai ) umitools_dedup ( ch_test_meta_bambai )

View file

@ -13,11 +13,12 @@ tools:
documentation: https://umi-tools.readthedocs.io/en/latest/ documentation: https://umi-tools.readthedocs.io/en/latest/
processes: processes:
- dedup: - dedup:
opperation: | operation: |
Set command args to params.umitools_dedup_args Set command args to params.umitools_dedup_args
The program will execute with the following pattern: umi_tools dedeup ARGS -I $bam -S SAMPLE_ID.dedup.bam --output-stats=SAMPLE_ID The program will execute with the following pattern:
umi_tools dedup --log={SAMPLE_ID}.dedup.log {params.umitools_dedup_args} -I {SAMPLE_ID}.bam -S {SAMPLE_ID}.dedup.bam --output-stats={SAMPLE_ID}
description: | description: |
Groups PCR duplicates and deduplicates reads to yield one read per group. Groups PCR duplicates and de-duplicates reads to yield one read per group.
Use this when you want to remove the PCR duplicates prior to any downstream analysis. Use this when you want to remove the PCR duplicates prior to any downstream analysis.
input: input:
- sample_id: - sample_id:
@ -33,10 +34,10 @@ processes:
- dedupBam: - dedupBam:
type: tuple type: tuple
description: A tuple of samples id and output bam file description: A tuple of samples id and output bam file
pattern: *SAMPLE_ID.dedup.bam pattern: [sample_id, *SAMPLE_ID.dedup.bam]
- report: - report:
type: file type: file
description: Log file for the umi_tools opperation description: Log file for the umi_tools operation
pattern: *SAMPLE_ID.dedup.log pattern: *SAMPLE_ID.dedup.log
authors: authors:
- @candiceh08 - @candiceh08