Skip to content

Commit

Permalink
New module: wgsim (#2178)
Browse files Browse the repository at this point in the history
module wgsim
  • Loading branch information
priyanka-surana authored Oct 8, 2022
1 parent 63000a0 commit 276cd87
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
36 changes: 36 additions & 0 deletions modules/nf-core/wgsim/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
process WGSIM {
tag "$meta.id"
label 'process_medium'

conda (params.enable_conda ? "bioconda::wgsim=1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/wgsim:1.0--h5bf99c6_4':
'quay.io/biocontainers/wgsim:1.0--h5bf99c6_4' }"

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

output:
tuple val(meta), path("*.fastq"), emit: 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}"

def WGSIM_VERSION = "0.3.1-r13" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
wgsim \\
$args \\
$fasta \\
${prefix}_1.fastq ${prefix}_2.fastq
cat <<-END_VERSIONS > versions.yml
"${task.process}":
wgsim: $WGSIM_VERSION
END_VERSIONS
"""
}
43 changes: 43 additions & 0 deletions modules/nf-core/wgsim/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "wgsim"
description: simulating sequence reads from a reference genome
keywords:
- simulate
- fasta
- reads
tools:
- "wgsim":
description: "simulating sequence reads from a reference genome"
homepage: "https://github.com/lh3/wgsim"
documentation: "https://github.com/lh3/wgsim"
tool_dev_url: "https://github.com/lh3/wgsim"
doi: ""
licence: "['MIT']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: Genome fasta file
pattern: "*.{fa,fasta}"

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"
- fastq:
type: file
description: Simulated FASTQ read files
pattern: "*.{fastq}"

authors:
- "@priyanka-surana"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,10 @@ vsearch/usearchglobal:
- modules/nf-core/vsearch/usearchglobal/**
- tests/modules/nf-core/vsearch/usearchglobal/**

wgsim:
- modules/nf-core/wgsim/**
- tests/modules/nf-core/wgsim/**

whamg:
- modules/nf-core/whamg/**
- tests/modules/nf-core/whamg/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/nf-core/wgsim/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { WGSIM } from '../../../../modules/nf-core/wgsim/main.nf'

workflow test_wgsim {

input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]

WGSIM ( input )
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/wgsim/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
7 changes: 7 additions & 0 deletions tests/modules/nf-core/wgsim/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: wgsim test_wgsim
command: nextflow run ./tests/modules/nf-core/wgsim -entry test_wgsim -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/wgsim/nextflow.config
tags:
- wgsim
files:
- path: output/wgsim/test_1.fastq
- path: output/wgsim/test_2.fastq

0 comments on commit 276cd87

Please sign in to comment.