-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
286 additions
and
171 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
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,8 @@ | ||
name: trimgalore | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::trim-galore=0.6.7 | ||
- bioconda::cutadapt=3.4 |
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,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 | ||
""" | ||
} | ||
} |
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,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" |
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,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() } | ||
) | ||
} | ||
} | ||
} |
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,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" | ||
} | ||
} |
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,2 @@ | ||
trimgalore: | ||
- modules/nf-core/trimgalore/** |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.