mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
new module: md5sum
This commit is contained in:
parent
4dff258262
commit
853b623969
6 changed files with 108 additions and 4 deletions
35
modules/md5sum/main.nf
Normal file
35
modules/md5sum/main.nf
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
process MD5SUM {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
if (params.enable_conda) {
|
||||||
|
exit 1, "Conda environments cannot be used when using bcl-convert. Please use docker or singularity containers."
|
||||||
|
}
|
||||||
|
container "debian:bullseye-slim"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(file)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.md5"), emit: checksum
|
||||||
|
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}"
|
||||||
|
|
||||||
|
"""
|
||||||
|
md5sum \\
|
||||||
|
$args \\
|
||||||
|
${file} \\
|
||||||
|
> ${file}.md5
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
md5sum: \$(echo \$(md5sum --version 2>&1 | head -n 1| sed 's/^.*) //;' ))
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
39
modules/md5sum/meta.yml
Normal file
39
modules/md5sum/meta.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
name: "md5sum"
|
||||||
|
description: Create an MD5 (128-bit) checksum
|
||||||
|
keywords:
|
||||||
|
- checksum
|
||||||
|
tools:
|
||||||
|
- "md5sum":
|
||||||
|
description: Create an MD5 (128-bit) checksum
|
||||||
|
homepage: "https://www.gnu.org"
|
||||||
|
documentation: "https://man7.org/linux/man-pages/man1/md5sum.1.html"
|
||||||
|
licence: GPLv3+
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- file:
|
||||||
|
type: file
|
||||||
|
description: Any file
|
||||||
|
pattern: "*.*"
|
||||||
|
|
||||||
|
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"
|
||||||
|
- checksum:
|
||||||
|
type: file
|
||||||
|
description: File containing checksum
|
||||||
|
pattern: "*.md5"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@matthdsm"
|
|
@ -1058,10 +1058,6 @@ krona/kronadb:
|
||||||
- modules/krona/kronadb/**
|
- modules/krona/kronadb/**
|
||||||
- tests/modules/krona/kronadb/**
|
- tests/modules/krona/kronadb/**
|
||||||
|
|
||||||
krona/ktupdatetaxonomy:
|
|
||||||
- modules/krona/ktupdatetaxonomy/**
|
|
||||||
- tests/modules/krona/ktupdatetaxonomy/**
|
|
||||||
|
|
||||||
krona/ktimporttaxonomy:
|
krona/ktimporttaxonomy:
|
||||||
- modules/krona/ktimporttaxonomy/**
|
- modules/krona/ktimporttaxonomy/**
|
||||||
- tests/modules/krona/ktimporttaxonomy/**
|
- tests/modules/krona/ktimporttaxonomy/**
|
||||||
|
@ -1070,6 +1066,10 @@ krona/ktimporttext:
|
||||||
- modules/krona/ktimporttext/**
|
- modules/krona/ktimporttext/**
|
||||||
- tests/modules/krona/ktimporttext/**
|
- tests/modules/krona/ktimporttext/**
|
||||||
|
|
||||||
|
krona/ktupdatetaxonomy:
|
||||||
|
- modules/krona/ktupdatetaxonomy/**
|
||||||
|
- tests/modules/krona/ktupdatetaxonomy/**
|
||||||
|
|
||||||
last/dotplot:
|
last/dotplot:
|
||||||
- modules/last/dotplot/**
|
- modules/last/dotplot/**
|
||||||
- tests/modules/last/dotplot/**
|
- tests/modules/last/dotplot/**
|
||||||
|
@ -1190,6 +1190,10 @@ maxbin2:
|
||||||
- modules/maxbin2/**
|
- modules/maxbin2/**
|
||||||
- tests/modules/maxbin2/**
|
- tests/modules/maxbin2/**
|
||||||
|
|
||||||
|
md5sum:
|
||||||
|
- modules/md5sum/**
|
||||||
|
- tests/modules/md5sum/**
|
||||||
|
|
||||||
medaka:
|
medaka:
|
||||||
- modules/medaka/**
|
- modules/medaka/**
|
||||||
- tests/modules/medaka/**
|
- tests/modules/medaka/**
|
||||||
|
|
15
tests/modules/md5sum/main.nf
Normal file
15
tests/modules/md5sum/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { MD5SUM } from '../../../modules/md5sum/main.nf'
|
||||||
|
|
||||||
|
workflow test_md5sum {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
|
||||||
|
]
|
||||||
|
|
||||||
|
MD5SUM ( input )
|
||||||
|
}
|
3
tests/modules/md5sum/nextflow.config
Normal file
3
tests/modules/md5sum/nextflow.config
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
process {
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
}
|
8
tests/modules/md5sum/test.yml
Normal file
8
tests/modules/md5sum/test.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
- name: md5sum test_md5sum
|
||||||
|
command: nextflow run tests/modules/md5sum -entry test_md5sum -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- md5sum
|
||||||
|
files:
|
||||||
|
- path: output/md5sum/test.paired_end.bam.md5
|
||||||
|
md5sum: 1163095be8fdfb2acb3cc6c027389c4b
|
||||||
|
- path: output/md5sum/versions.yml
|
Loading…
Reference in a new issue