Skip to content
Open
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
7 changes: 7 additions & 0 deletions modules/ph-core/amplicov/enviromental.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: amplicov
channels:
- conda-forge
- bioconda
- defaults
dependencies:
-bioconda::amplicon_coverage_plot=0.3.3
58 changes: 58 additions & 0 deletions modules/ph-core/amplicov/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

process AMPLICOV {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/amplicon_coverage_plot:0.3.3--pyhdfd78af_0':
'biocontainers/amplicon_coverage_plot:0.3.3--pyhdfd78af_0' }"



input:

tuple val(meta), path(bam)
tuple val(meta), val(irma_type)
path bedpe

output:

// output of amplicov is not a sorted bam but just coverage files.

tuple val(meta), path("*amplicon_coverage.txt"), emit: coverage
tuple val(meta), path("*amplicon_coverage.html"), emit: coverage_html
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 refname = irma_type

"""
amplicov --bedpe ${bedpe} --bam ${bam} --count_primer -o . -p ${bam.BaseName} -r ${refname}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
amplicov: \$(amplicov --version |& sed '1!d ; s/amplicov //')
END_VERSIONS

"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
mkdir -p ${meta}/
touch ${meta}/stub.amplicon_coverage.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
amplicov: \$(samtools --version |& sed '1!d ; s/samtools //')
END_VERSIONS
"""
}
53 changes: 53 additions & 0 deletions modules/ph-core/amplicov/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: amplicov
description: Script to generate amplicon coverage
keywords:
- amplicon
- genome
- coverage
tools:
- amplicov:
description: |
Will generate information around amplicon coverage given a bam file and amplicon information provided in a bedpe/bed6 format
homepage: https://pypi.org/project/amplicov/0.3.3/
documentation: https://github.com/chienchi/amplicon_coverage_plot
doi: 10.1093/bioinformatics/btp352 **
license: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM/CRAM/SAM file(s)
pattern: "*.{bam,cram,sam}"
- bedpe:
type: file
description: |
file format that concisely describe disjoint genome features, such as structural variations or paired-end sequence alignments
pattern: "*.{bedpe,bed6}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- coverage:
type: file
description: amplicon coverage information in tsv format
pattern: "*.{txt}"
- coverage_html:
type: file
description: amplicon coverage information in html format
pattern: "*.{html}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@chienchi"
- "@pvanheus"
maintainers:
- "@chienchi"
- "@pvanheus"
34 changes: 34 additions & 0 deletions modules/ph-core/amplicov/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
nextflow_process {

name "Test Process AMPLICOV"
script "../main.nf"
process "AMPLICOV"

test("Test Process AMPLICOV") {
config "./nextflow.config"
when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/bam/test.paired_end.bam", checkIfExists: true)
])
input[1] = Channel.of([
[ id:'test', single_end:false ], // meta map
"SARS-CoV-2"])
input[2] = Channel.of([
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/bed/test.bedpe', checkIfExists: true)
])
"""
}
}

then {
assert process.success
assert process.trace.tasks().size() == 1

}

}

}