Skip to content

Commit

Permalink
removed umitools extract
Browse files Browse the repository at this point in the history
  • Loading branch information
melferink committed Mar 7, 2024
1 parent 8c13ee0 commit 48fc293
Show file tree
Hide file tree
Showing 14 changed files with 286 additions and 171 deletions.
8 changes: 4 additions & 4 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
"git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62",
"installed_by": ["modules"]
},
"umitools/dedup": {
"trimgalore": {
"branch": "master",
"git_sha": "ff7e93715a2acecf3f143ec78c9858deba2984d0",
"git_sha": "d2c5e76f291379f3dd403e48e46ed7e6ba5da744",
"installed_by": ["modules"]
},
"umitools/extract": {
"umitools/dedup": {
"branch": "master",
"git_sha": "d2c5e76f291379f3dd403e48e46ed7e6ba5da744",
"git_sha": "ff7e93715a2acecf3f143ec78c9858deba2984d0",
"installed_by": ["modules"]
}
}
Expand Down
8 changes: 8 additions & 0 deletions modules/nf-core/trimgalore/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: trimgalore
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::trim-galore=0.6.7
- bioconda::cutadapt=3.4
75 changes: 75 additions & 0 deletions modules/nf-core/trimgalore/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
process TRIMGALORE {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0' :
'biocontainers/trim-galore:0.6.7--hdfd78af_0' }"

input:
tuple val(meta), path(reads)

output:
tuple val(meta), path("*{3prime,5prime,trimmed,val}*.fq.gz"), emit: reads
tuple val(meta), path("*report.txt") , emit: log , optional: true
tuple val(meta), path("*unpaired*.fq.gz") , emit: unpaired, optional: true
tuple val(meta), path("*.html") , emit: html , optional: true
tuple val(meta), path("*.zip") , emit: zip , optional: true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
// Calculate number of --cores for TrimGalore based on value of task.cpus
// See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019
// See: https://github.com/nf-core/atacseq/pull/65
def cores = 1
if (task.cpus) {
cores = (task.cpus as int) - 4
if (meta.single_end) cores = (task.cpus as int) - 3
if (cores < 1) cores = 1
if (cores > 8) cores = 8
}

// Added soft-links to original fastqs for consistent naming in MultiQC
def prefix = task.ext.prefix ?: "${meta.id}"
if (meta.single_end) {
def args_list = args.split("\\s(?=--)").toList()
args_list.removeAll { it.toLowerCase().contains('_r2 ') }
"""
[ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz
trim_galore \\
${args_list.join(' ')} \\
--cores $cores \\
--gzip \\
${prefix}.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//')
cutadapt: \$(cutadapt --version)
END_VERSIONS
"""
} else {
"""
[ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz
[ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz
trim_galore \\
$args \\
--cores $cores \\
--paired \\
--gzip \\
${prefix}_1.fastq.gz \\
${prefix}_2.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//')
cutadapt: \$(cutadapt --version)
END_VERSIONS
"""
}
}
68 changes: 68 additions & 0 deletions modules/nf-core/trimgalore/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: trimgalore
description: Trim FastQ files using Trim Galore!
keywords:
- trimming
- adapters
- sequencing adapters
- fastq
tools:
- trimgalore:
description: |
A wrapper tool around Cutadapt and FastQC to consistently apply quality
and adapter trimming to FastQ files, with some extra functionality for
MspI-digested RRBS-type (Reduced Representation Bisufite-Seq) libraries.
homepage: https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/
documentation: https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md
licence: ["GPL-3.0-or-later"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: |
List of input adapter trimmed FastQ files of size 1 and 2 for
single-end and paired-end data, respectively.
pattern: "*{3prime,5prime,trimmed,val}*.fq.gz"
- unpaired:
type: file
description: |
FastQ files containing unpaired reads from read 1 or read 2
pattern: "*unpaired*.fq.gz"
- html:
type: file
description: FastQC report (optional)
pattern: "*_{fastqc.html}"
- zip:
type: file
description: FastQC report archive (optional)
pattern: "*_{fastqc.zip}"
- log:
type: file
description: Trim Galore! trimming report
pattern: "*_{report.txt}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@drpatelh"
- "@ewels"
- "@FelixKrueger"
maintainers:
- "@drpatelh"
- "@ewels"
- "@FelixKrueger"
103 changes: 103 additions & 0 deletions modules/nf-core/trimgalore/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
nextflow_process {

name "Test Process TRIMGALORE"
script "../main.nf"
process "TRIMGALORE"
tag "modules"
tag "modules_nfcore"
tag "trimgalore"

test("test_trimgalore_single_end") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:true ], // meta map
[ file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ]
]
"""
}
}

then {
def read_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1",
"TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT",
"AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE<EEAAAEEEEEEEEEAAAAEAEEEAEEEEEE<AAAA",
"@ERR5069949.576388 NS500628:121:HK3MMAFX2:4:11501:11167:14939/1",
"ACTGTTTTCTTTGTAGAAAACATCCGTAATAGGACCTTTGTATTCTGAGGACTTTGTAAGTAAAGCACCGTCTATGC",
"AAA6AEEEEEEEEEAEEE/6EEAEEEAEEEEEAEEEEEEEEEEEEEEEEEEEEE<AAEEEEEEEEEEE</EEEA/AE"]
def report1_lines = ["1 19 25.0 0 19",
"2 10 6.2 0 10",
"3 1 1.6 0 1"]
assertAll(
{ assert process.success },
{ read_lines.each { read_line ->
{ assert path(process.out.reads.get(0).get(1)).linesGzip.contains(read_line) }
}
},
{ report1_lines.each { report1_line ->
{ assert path(process.out.log.get(0).get(1)).getText().contains(report1_line) }
}
},
{ assert snapshot(process.out.versions).match() }
)
}
}

test("test_trimgalore_paired_end") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true)
]
]
"""
}
}

then {
def read1_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1",
"TCATAAACCAAAGCACTCACAGTGTCAACAATTTCAGCAGGACAACGCCGACAAGTTCCGAGGAACATGTCTGGACCTATAGTTTTCATAAGTCTACACACTGAATTGAAATATTCTGGTTCTAGTGTGCCCTTAGTTAGCAATGTGCGT",
"AAAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEE<EEAAAEEEEEEEEEAAAAEAEEEAEEEEEE<AAAA",
"@ERR5069949.576388 NS500628:121:HK3MMAFX2:4:11501:11167:14939/1",
"ACTGTTTTCTTTGTAGAAAACATCCGTAATAGGACCTTTGTATTCTGAGGACTTTGTAAGTAAAGCACCGTCTATGC",
"AAA6AEEEEEEEEEAEEE/6EEAEEEAEEEEEAEEEEEEEEEEEEEEEEEEEEE<AAEEEEEEEEEEE</EEEA/AE"]
def read2_lines = ["@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/2",
"ATGTGTACATTGGCGACCCTGCTCAATTACCTGCACCACGCACATTGCTAACTAAGGGCACACTAGAACCAGAATATTTCAATTCAGTGTGTAGACTTATGAAAACTATAGGTCCAGACATGTTCCTCGGAACTTGTCGGCGTTGTCCTG",
"AAAAAEEEEEEEEEE/EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEE/EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAAEEEEEEEAEEEEEAAEEEEEEEEEAAEAAA<<EAAEEEEEEEAAA<<<AE",
"@ERR5069949.576388 NS500628:121:HK3MMAFX2:4:11501:11167:14939/2",
"GCATAGACGGTGCTTTACTTACAAAGTCCTCAGAATACAAAGGTCCTATTACGGATGTTTTCTACAAAGAAAACAGT",
"AAAAA6EEAEEEEEAEEAEEAEEEEEEA6EEEEAEEAEEEEE6EEEEEEAEEEEA///A<<EEEEEEEEEAEEEEEE"]
def report1_lines = ["1 19 25.0 0 19",
"2 10 6.2 0 10",
"3 1 1.6 0 1"]
def report2_lines = ["1 28 25.0 0 28",
"2 10 6.2 0 10",
"3 1 1.6 0 1"]
assertAll(
{ assert process.success },
{ read1_lines.each { read1_line ->
{ assert path(process.out.reads.get(0).get(1).get(0)).linesGzip.contains(read1_line) }
}
},
{ read2_lines.each { read2_line ->
{ assert path(process.out.reads.get(0).get(1).get(1)).linesGzip.contains(read2_line) }
}
},
{ report1_lines.each { report1_line ->
{ assert path(process.out.log.get(0).get(1).get(0)).getText().contains(report1_line) }
}
},
{ report2_lines.each { report2_line ->
{ assert path(process.out.log.get(0).get(1).get(1)).getText().contains(report2_line) }
}
},
{ assert snapshot(process.out.versions).match() }
)
}
}
}
26 changes: 26 additions & 0 deletions modules/nf-core/trimgalore/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"test_trimgalore_single_end": {
"content": [
[
"versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
},
"timestamp": "2024-02-29T16:33:20.401347"
},
"test_trimgalore_paired_end": {
"content": [
[
"versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
},
"timestamp": "2024-02-29T16:33:28.960497"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/trimgalore/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trimgalore:
- modules/nf-core/trimgalore/**
7 changes: 0 additions & 7 deletions modules/nf-core/umitools/extract/environment.yml

This file was deleted.

56 changes: 0 additions & 56 deletions modules/nf-core/umitools/extract/main.nf

This file was deleted.

Loading

0 comments on commit 48fc293

Please sign in to comment.