Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions modules/nf-core/nanomonsv/get/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all TODO's

// https://github.com/nf-core/modules/tree/master/modules/nf-core/
// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace:
// https://nf-co.re/join
// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters.
// All other parameters MUST be provided using the "task.ext" directive, see here:
// https://www.nextflow.io/docs/latest/process.html#ext
// where "task.ext" is a string.
// Any parameters that need to be evaluated in the context of a particular sample
// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately.
// TODO nf-core: Software that can be piped together SHOULD be added to separate module files
// unless there is a run-time, storage advantage in implementing in this way
// e.g. it's ok to have a single module for bwa to output BAM instead of SAM:
// bwa mem | samtools view -B -T ref.fasta
// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty
// list (`[]`) instead of a file can be used to work around this issue.

process NANOMONSV_GET {
tag "$meta.id"
label 'process_high'

conda "bioconda::nanomonsv=0.5.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/nanomonsv:0.5.0--pyhdfd78af_0':
'quay.io/biocontainers/nanomonsv:0.5.0--pyhdfd78af_0' }"

input:
tuple val(meta), path(bam), path(bai), path(parse_intermediates), path(control_bam), path(control_bai), path(control_parse_intermediates)
path reference_fasta

output:
tuple val(meta), path("${prefix}.nanomonsv.result.vcf") , emit: vcf
Comment thread
matthdsm marked this conversation as resolved.
tuple val(meta), path("${prefix}.nanomonsv.result.txt") , emit: text_report
tuple val(meta), path("${prefix}.nanomonsv.supporting_read.txt"), emit: supp_read
Comment thread
matthdsm marked this conversation as resolved.
path "versions.yml" , emit: versions

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

script:
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
def control_prefix = task.ext.control_prefix ?: "${meta.id}"
if (control_prefix) {
args += " --control_prefix ${control_prefix} --control_bam ${control_bam}"
}
"""
nanomonsv get ${args} ${prefix} \
${bam} ${reference_fasta}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
nanomonsv: \$(echo \$(nanomonsv --version 2>&1) | sed 's/^nanomonsv //')
mafft: \$(echo \$(mafft --version 2>&1) | sed 's/^v//; s/ (.*//')
racon: \$(echo \$(racon --version 2>&1) | sed 's/^v//')
tabix: \$(echo \$(tabix --version 2>&1) | sed 's/^tabix (htslib) //; s/ Copyright.*//')
bgzip: \$(echo \$(bgzip --version 2>&1) | sed 's/^bgzip (htslib) //; s/ Copyright.*//')
python: \$(python3 --version | sed 's/Python //g')
END_VERSIONS
"""
}
51 changes: 51 additions & 0 deletions modules/nf-core/nanomonsv/get/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "nanomonsv_get"
## TODO nf-core: Add a description of the module and list keywords
description: write your description here
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add description

keywords:
- sort
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add keywords

tools:
- "nanomonsv":
## TODO nf-core: Add a description and other details for the software below
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove TODO's

description: "Python tools for detecting structural variation from nanopore sequence data"
homepage: "None"
documentation: "None"
tool_dev_url: "None"
doi: ""
licence: "['GPL v3']"

## TODO nf-core: Add a description of all of the variables used as input
input:
# Only when we have meta
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
#
## TODO nf-core: Delete / customise this example input
- bam:
type: file
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

## TODO nf-core: Add a description of all of the variables used as output
output:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe outputs

#Only when we have meta
- 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"
## TODO nf-core: Delete / customise this example output
- bam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

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

nanomonsv/get:
- modules/nf-core/nanomonsv/get/**
- tests/modules/nf-core/nanomonsv/get/**

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

nextflow.enable.dsl = 2

include { NANOMONSV_GET } from '../../../../../modules/nf-core/nanomonsv/get/main.nf'

workflow test_nanomonsv_get {

def data_path = 'https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/nanomonsv'
input = channel.of([
[ id:'test' ], // meta map
file("${data_path}/input_bam/test_tumor.bam", checkIfExists: true),
file("${data_path}/input_bam/test_tumor.bam.bai", checkIfExists: true),
file("${data_path}/parse_output/test_tumor/*.gz*"),
file("${data_path}/input_bam/test_ctrl.bam", checkIfExists: true),
file("${data_path}/input_bam/test_ctrl.bam.bai", checkIfExists: true),
file("${data_path}/parse_output/test_ctrl/*.gz*"),
])
ref = file('s3://ngi-igenomes/igenomes/Homo_sapiens/NCBI/GRCh38/Sequence/WholeGenomeFasta/genome.fa')

NANOMONSV_GET ( input, ref )
}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/nanomonsv/get/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
process {

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

withName: 'NANOMONSV_GET' {
ext.prefix = { "${meta.id}_tumor" }
ext.control_prefix = { "${meta.id}_ctrl" }
}
}
15 changes: 15 additions & 0 deletions tests/modules/nf-core/nanomonsv/get/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: nanomonsv get test_nanomonsv_get
command: nextflow run ./tests/modules/nf-core/nanomonsv/get -entry test_nanomonsv_get -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/nanomonsv/get/nextflow.config
tags:
- nanomonsv
- nanomonsv/get
files:
- path: output/nanomonsv/test_tumor.nanomonsv.result.txt
md5sum: 4093bd514c334059b91d77b084de961d
- path: output/nanomonsv/test_tumor.nanomonsv.result.vcf
contains:
- "chr18\t68712223\td_2\tC\t<DEL>\t.\tPASS\tEND=68715588;SVTYPE=DEL;SVLEN=-3365\tTR:VR\t25:4\t24:0\n"
- path: output/nanomonsv/test_tumor.nanomonsv.supporting_read.txt
contains:
- "chr10\t87940538\t+\tchr10\t87952584\t-\tATAGAGATTATACTTTGTGTA\tr_0\t37b0700e-96e1-4d0c-9299-18eabf25515d\t13944\t+"
- path: output/nanomonsv/versions.yml