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/nf-core/oarfish/alignmentmode/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::oarfish=0.10.3"
49 changes: 49 additions & 0 deletions modules/nf-core/oarfish/alignmentmode/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process OARFISH_ALIGNMENTMODE {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/89/890d90ebb61b3756527fabe481d801a8e203453fde05a67ccc01640a9a445cd9/data':
'community.wave.seqera.io/library/oarfish:0.10.3--837f9667a3c87dbb' }"

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

output:
tuple val(meta), path("${prefix}.quant") , emit: quant
tuple val(meta), path("${prefix}.meta_info.json"), emit: meta_info
tuple val(meta), path("${prefix}.ambig_info.tsv"), emit: ambig_info
tuple val(meta), path("${prefix}.infreps.pq") , optional: true, emit: infreps
tuple val(meta), path("${prefix}.prob.lz4") , optional: true, emit: prob
tuple val("${task.process}"), val('oarfish'), eval("oarfish --version | sed 's/oarfish //'"), topic: versions, emit: versions_oarfish

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

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

"""
oarfish \\
--alignments ${bam} \\
--output ${prefix} \\
--threads ${task.cpus} \\
--filter-group no-filters \\
--model-coverage \\
--verbose \\
${args}
"""

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

"""
touch ${prefix}.quant
touch ${prefix}.ambig_info.tsv
touch ${prefix}.infreps.pq
touch ${prefix}.prob.lz4
touch ${prefix}.meta_info.json
"""
}
118 changes: 118 additions & 0 deletions modules/nf-core/oarfish/alignmentmode/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: "oarfish_alignmentmode"
description: oarfish is a program for quantifying transcript-level expression
from long-read (i.e. Oxford nanopore cDNA and direct RNA and PacBio)
sequencing technologies. It handles multi-mapping reads through the use of
probabilistic allocation via an expectation-maximization (EM) algorithm.
keywords:
- bam
- transcript
- quantification
- alignment-mode
tools:
- "oarfish":
description: "oarfish is a tool for fast, accurate and versatile transcript quantification
from long-read RNA-seq data"
homepage: "https://github.com/COMBINE-lab/oarfish"
documentation: "https://github.com/COMBINE-lab/oarfish"
tool_dev_url: "https://github.com/COMBINE-lab/oarfish"
doi: "10.1101/2024.02.28.582591v1"
licence:
- "BSD-3-clause"
identifier: biotools:oarfish
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- bam:
type: file
description: Sorted BAM/CRAM/SAM file from long-read RNA-seq data
pattern: "*.{bam,cram,sam}"
ontologies:
- edam: "http://edamontology.org/format_2572"
output:
quant:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${prefix}.quant:
type: file
description: Quantification results in TSV format
pattern: "${prefix}.quant"
ontologies: []
meta_info:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${prefix}.meta_info.json:
type: file
description: Meta information in JSON format
pattern: "${prefix}.meta_info.json"
ontologies:
- edam: "http://edamontology.org/format_3464"
ambig_info:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${prefix}.ambig_info.tsv:
type: file
description: Ambiguity information in TSV format
pattern: "${prefix}.ambig_info.tsv"
ontologies:
- edam: "http://edamontology.org/format_3475"
infreps:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${prefix}.infreps.pq:
type: file
description: Estimated counts in Parquet format
pattern: "${prefix}.infreps.pq"
ontologies:
- edam: "http://edamontology.org/format_3940"
prob:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${prefix}.prob.lz4:
type: file
description: Assignment probabilities in LZ4-compressed format
pattern: "${prefix}.prob.lz4"
ontologies:
- edam: "http://edamontology.org/format_3475"
versions_oarfish:
- - ${task.process}:
type: string
description: The name of the process
- oarfish:
type: string
description: The name of the tool
- oarfish --version | sed 's/oarfish //':
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- oarfish:
type: string
description: The name of the tool
- oarfish --version | sed 's/oarfish //':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@khersameesh24"
maintainers:
- "@khersameesh24"
148 changes: 148 additions & 0 deletions modules/nf-core/oarfish/alignmentmode/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "oarfish"
tag "oarfish/alignmentmode"
tag "samtools/collate"

test("long-read pacbio - bam") {

setup {
run("SAMTOOLS_COLLATE") {
script "modules/nf-core/samtools/collate/main.nf"
process {
"""
input[0] = [
[id:'test'],
file('https://raw.githubusercontent.com/khersameesh24/test-datasets/modules/data/genomics/homo_sapiens/pacbio/bam/test_sample.mmaligned.sorted.bam', checkIfExists: true)
]
input[1] = [[], [], []]
"""
}
}
}

when {
process {
"""
input[0] = SAMTOOLS_COLLATE.out.bam
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ['meta_info'])).match() }
)
}
}

test("long-read pacbio - bam - stub") {

options "-stub"

setup {
run("SAMTOOLS_COLLATE") {
script "modules/nf-core/samtools/collate/main.nf"
process {
"""
input[0] = [
[id:'test'],
file('https://raw.githubusercontent.com/khersameesh24/test-datasets/modules/data/genomics/homo_sapiens/pacbio/bam/test_sample.mmaligned.sorted.bam', checkIfExists: true)
]
input[1] = [[], [], []]
"""
}
}
}

when {
process {
"""
input[0] = SAMTOOLS_COLLATE.out.bam
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

test("long-read ont - bam") {

setup {
run("SAMTOOLS_COLLATE") {
script "modules/nf-core/samtools/collate/main.nf"
process {
"""
input[0] = [
[id:'test'],
file('https://raw.githubusercontent.com/khersameesh24/test-datasets/modules/data/genomics/homo_sapiens/nanopore/bam/test_sample.mmaligned.sorted.bam', checkIfExists: true)
]
input[1] = [[], [], []]
"""
}
}
}

when {
process {
"""
input[0] = SAMTOOLS_COLLATE.out.bam
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ['meta_info'])).match() }
)
}
}

test("long-read ont - bam - stub") {

options "-stub"

setup {
run("SAMTOOLS_COLLATE") {
script "modules/nf-core/samtools/collate/main.nf"
process {
"""
input[0] = [
[id:'test'],
file('https://raw.githubusercontent.com/khersameesh24/test-datasets/modules/data/genomics/homo_sapiens/nanopore/bam/test_sample.mmaligned.sorted.bam', checkIfExists: true)
]
input[1] = [[], [], []]
"""
}
}
}

when {
process {
"""
input[0] = SAMTOOLS_COLLATE.out.bam
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
}
Loading