mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
Add AdapterRemovalFixPrefix (#1424)
* Add AdapterRemovalFixPrefix * Prettifying Co-authored-by: Alexander Peltzer <apeltzer@users.noreply.github.com>
This commit is contained in:
parent
5297d27fbf
commit
8c00897853
6 changed files with 122 additions and 0 deletions
38
modules/adapterremovalfixprefix/main.nf
Normal file
38
modules/adapterremovalfixprefix/main.nf
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
def VERSION = '0.05'
|
||||||
|
|
||||||
|
process ADAPTERREMOVALFIXPREFIX {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::adapterremovalfixprefix=0.0.5" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/adapterremovalfixprefix:0.0.5--hdfd78af_2':
|
||||||
|
'quay.io/biocontainers/adapterremovalfixprefix:0.0.5--hdfd78af_2' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(fastq)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.fq.gz"), emit: fixed_fastq
|
||||||
|
path "versions.yml" , emit: versions
|
||||||
|
|
||||||
|
when:
|
||||||
|
task.ext.when == null || task.ext.when
|
||||||
|
|
||||||
|
script:
|
||||||
|
def args = task.ext.args ?: ''
|
||||||
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
if ("$fastq" == "${prefix}.fq.gz") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
|
||||||
|
|
||||||
|
"""
|
||||||
|
AdapterRemovalFixPrefix \\
|
||||||
|
$fastq \\
|
||||||
|
$args \\
|
||||||
|
| gzip > ${prefix}.fq.gz
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
adapterremovalfixprefix: $VERSION
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
43
modules/adapterremovalfixprefix/meta.yml
Normal file
43
modules/adapterremovalfixprefix/meta.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
name: adapterremovalfixprefix
|
||||||
|
description: Fixes prefixes from AdapterRemoval2 output to make sure no clashing read names are in the output. For use with DeDup.
|
||||||
|
keywords:
|
||||||
|
- adapterremoval
|
||||||
|
- fastq
|
||||||
|
- dedup
|
||||||
|
tools:
|
||||||
|
- adapterremovalfixprefix:
|
||||||
|
description: Fixes adapter removal prefixes to make sure no clashing read names are in the output.
|
||||||
|
homepage: https://github.com/apeltzer/AdapterRemovalFixPrefix
|
||||||
|
documentation: None
|
||||||
|
tool_dev_url: https://github.com/apeltzer/AdapterRemovalFixPrefix
|
||||||
|
doi: "10.1186/s13059-016-0918-z"
|
||||||
|
licence: ["GPL v3"]
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- fastq:
|
||||||
|
type: file
|
||||||
|
description: FASTQ file from AdapterRemoval2
|
||||||
|
pattern: "*.{fq.gz,fastq.gz}"
|
||||||
|
|
||||||
|
output:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- versions:
|
||||||
|
type: file
|
||||||
|
description: File containing software versions
|
||||||
|
pattern: "versions.yml"
|
||||||
|
- fixed_fastq:
|
||||||
|
type: file
|
||||||
|
description: FASTQ file with fixed read prefixes for DeDup
|
||||||
|
pattern: "*.{fq.gz}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@jfy133"
|
|
@ -14,6 +14,10 @@ adapterremoval:
|
||||||
- modules/adapterremoval/**
|
- modules/adapterremoval/**
|
||||||
- tests/modules/adapterremoval/**
|
- tests/modules/adapterremoval/**
|
||||||
|
|
||||||
|
adapterremovalfixprefix:
|
||||||
|
- modules/adapterremovalfixprefix/**
|
||||||
|
- tests/modules/adapterremovalfixprefix/**
|
||||||
|
|
||||||
agrvate:
|
agrvate:
|
||||||
- modules/agrvate/**
|
- modules/agrvate/**
|
||||||
- tests/modules/agrvate/**
|
- tests/modules/agrvate/**
|
||||||
|
|
19
tests/modules/adapterremovalfixprefix/main.nf
Normal file
19
tests/modules/adapterremovalfixprefix/main.nf
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { ADAPTERREMOVAL } from '../../../modules/adapterremoval/main.nf'
|
||||||
|
include { ADAPTERREMOVALFIXPREFIX } from '../../../modules/adapterremovalfixprefix/main.nf'
|
||||||
|
|
||||||
|
workflow test_adapterremovalfixprefix {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
ADAPTERREMOVAL ( input, [] )
|
||||||
|
ADAPTERREMOVALFIXPREFIX ( ADAPTERREMOVAL.out.collapsed )
|
||||||
|
}
|
9
tests/modules/adapterremovalfixprefix/nextflow.config
Normal file
9
tests/modules/adapterremovalfixprefix/nextflow.config
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
withName: ADAPTERREMOVAL {
|
||||||
|
ext.args = "--collapse"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
9
tests/modules/adapterremovalfixprefix/test.yml
Normal file
9
tests/modules/adapterremovalfixprefix/test.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
- name: adapterremovalfixprefix test_adapterremovalfixprefix
|
||||||
|
command: nextflow run tests/modules/adapterremovalfixprefix -entry test_adapterremovalfixprefix -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- adapterremovalfixprefix
|
||||||
|
files:
|
||||||
|
- path: output/adapterremovalfixprefix/test.fq.gz
|
||||||
|
md5sum: ff956de3532599a56c3efe5369f0953f
|
||||||
|
- path: output/adapterremovalfixprefix/versions.yml
|
||||||
|
md5sum: 983cb58079bf015c1d489a7e48261746
|
Loading…
Reference in a new issue