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
84 changes: 47 additions & 37 deletions modules.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
{
"name": "nf-core/lncpipe",
"homePage": "https://github.com/nf-core/lncpipe",
"repos": {
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"fastqc": {
"branch": "master",
"git_sha": "08108058ea36a63f141c25c4e75f9f872a5b2296",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "f0719ae309075ae4a291533883847c3f7c441dad",
"installed_by": ["modules"]
}
}
},
"subworkflows": {
"nf-core": {
"utils_nextflow_pipeline": {
"branch": "master",
"git_sha": "c2b22d85f30a706a3073387f30380704fcae013b",
"installed_by": ["subworkflows"]
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a",
"installed_by": ["subworkflows"]
},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e",
"installed_by": ["subworkflows"]
}
}
}
"name": "nf-core/lncpipe",
"homePage": "https://github.com/nf-core/lncpipe",
"repos": {
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"fastqc": {
"branch": "master",
"git_sha": "08108058ea36a63f141c25c4e75f9f872a5b2296",
"installed_by": ["modules"]
},
"kallisto/index": {
"branch": "master",
"git_sha": "81880787133db07d9b4c1febd152c090eb8325dc",
"installed_by": ["modules"]
},
"kallisto/quant": {
"branch": "master",
"git_sha": "81880787133db07d9b4c1febd152c090eb8325dc",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "f0719ae309075ae4a291533883847c3f7c441dad",
"installed_by": ["modules"]
}
}
},
"subworkflows": {
"nf-core": {
"utils_nextflow_pipeline": {
"branch": "master",
"git_sha": "c2b22d85f30a706a3073387f30380704fcae013b",
"installed_by": ["subworkflows"]
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "51ae5406a030d4da1e49e4dab49756844fdd6c7a",
"installed_by": ["subworkflows"]
},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e",
"installed_by": ["subworkflows"]
}
}
}
}
}
}
7 changes: 7 additions & 0 deletions modules/nf-core/kallisto/index/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::kallisto=0.51.1
44 changes: 44 additions & 0 deletions modules/nf-core/kallisto/index/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
process KALLISTO_INDEX {
tag "$fasta"
label 'process_medium'

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

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

output:
tuple val(meta), path("kallisto") , emit: index
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
"""
kallisto \\
index \\
$args \\
-i kallisto \\
$fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
kallisto: \$(echo \$(kallisto 2>&1) | sed 's/^kallisto //; s/Usage.*\$//')
END_VERSIONS
"""

stub:
"""
mkdir kallisto

cat <<-END_VERSIONS > versions.yml
"${task.process}":
kallisto: \$(echo \$(kallisto 2>&1) | sed 's/^kallisto //; s/Usage.*\$//')
END_VERSIONS
"""
}
46 changes: 46 additions & 0 deletions modules/nf-core/kallisto/index/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: kallisto_index
description: Create kallisto index
keywords:
- kallisto
- kallisto/index
- index
tools:
- kallisto:
description: Quantifying abundances of transcripts from bulk and single-cell RNA-Seq
data, or more generally of target sequences using high-throughput sequencing
reads.
homepage: https://pachterlab.github.io/kallisto/
documentation: https://pachterlab.github.io/kallisto/manual
tool_dev_url: https://github.com/pachterlab/kallisto
licence: ["BSD-2-Clause"]
identifier: biotools:kallisto
input:
- - meta:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'test' ]
- fasta:
type: file
description: genome fasta file
pattern: "*.{fasta}"
output:
- index:
- meta:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'test' ]
- kallisto:
type: directory
description: Kallisto genome index
pattern: "*.idx"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@ggabernet"
maintainers:
- "@ggabernet"
55 changes: 55 additions & 0 deletions modules/nf-core/kallisto/index/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
nextflow_process {

name "Test Process KALLISTO_INDEX"
script "../main.nf"
process "KALLISTO_INDEX"
tag "modules"
tag "modules_nfcore"
tag "kallisto"
tag "kallisto/index"

test("sarscov2 transcriptome.fasta") {

when {
process {
"""
input[0] = Channel.of([
[ id:'transcriptome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/transcriptome.fasta', checkIfExists: true)
])
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.index.get(0).get(1)).exists() },
{ assert snapshot(process.out.versions).match() }
)
}
}

test("sarscov2 transcriptome.fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'transcriptome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/transcriptome.fasta', checkIfExists: true)
])
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
51 changes: 51 additions & 0 deletions modules/nf-core/kallisto/index/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"sarscov2 transcriptome.fasta - stub": {
"content": [
{
"0": [
[
{
"id": "transcriptome"
},
[

]
]
],
"1": [
"versions.yml:md5,e23afe0f9a5d0dc20b05c27fe59ad041"
],
"index": [
[
{
"id": "transcriptome"
},
[

]
]
],
"versions": [
"versions.yml:md5,e23afe0f9a5d0dc20b05c27fe59ad041"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-19T18:51:55.402665844"
},
"sarscov2 transcriptome.fasta": {
"content": [
[
"versions.yml:md5,e23afe0f9a5d0dc20b05c27fe59ad041"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-19T18:51:42.328144373"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/kallisto/index/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kallisto/index:
- modules/nf-core/kallisto/index/**
7 changes: 7 additions & 0 deletions modules/nf-core/kallisto/quant/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::kallisto=0.51.1
84 changes: 84 additions & 0 deletions modules/nf-core/kallisto/quant/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
process KALLISTO_QUANT {
tag "$meta.id"
label 'process_high'

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

input:
tuple val(meta), path(reads)
tuple val(meta2), path(index)
path gtf
path chromosomes
val fragment_length
val fragment_length_sd

output:
tuple val(meta), path("${prefix}") , emit: results
tuple val(meta), path("*.run_info.json") , emit: json_info
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def gtf_input = gtf ? "--gtf ${gtf}" : ''
def chromosomes_input = chromosomes ? "--chromosomes ${chromosomes}" : ''

def single_end_params = ''
if (meta.single_end) {
if (!(fragment_length =~ /^\d+$/)) {
error "fragment_length must be set and numeric for single-end data"
}
if (!(fragment_length_sd =~ /^\d+$/)) {
error "fragment_length_sd must be set and numeric for single-end data"
}
single_end_params = "--single --fragment-length=${fragment_length} --sd=${fragment_length_sd}"
}

def strandedness = ''
if (!args.contains('--fr-stranded') && !args.contains('--rf-stranded')) {
strandedness = (meta.strandedness == 'forward') ? '--fr-stranded' :
(meta.strandedness == 'reverse') ? '--rf-stranded' : ''
}

"""
mkdir -p $prefix && kallisto quant \\
--threads ${task.cpus} \\
--index ${index} \\
${gtf_input} \\
${chromosomes_input} \\
${single_end_params} \\
${strandedness} \\
${args} \\
-o $prefix \\
${reads} 2> >(tee -a ${prefix}/kallisto_quant.log >&2)

cp ${prefix}/kallisto_quant.log ${prefix}.log
cp ${prefix}/run_info.json ${prefix}.run_info.json

cat <<-END_VERSIONS > versions.yml
"${task.process}":
kallisto: \$(echo \$(kallisto version) | sed "s/kallisto, version //g" )
END_VERSIONS
"""

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

"""
mkdir -p $prefix
touch ${prefix}.log
touch ${prefix}.run_info.json

cat <<-END_VERSIONS > versions.yml
"${task.process}":
kallisto: \$(echo \$(kallisto version) | sed "s/kallisto, version //g" )
END_VERSIONS
"""
}
Loading
Loading