Skip to content
Merged
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
2 changes: 1 addition & 1 deletion modules/nf-core/ribotish/predict/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::ribotish=0.2.7
- bioconda::ribotish=0.2.8
19 changes: 6 additions & 13 deletions modules/nf-core/ribotish/predict/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process RIBOTISH_PREDICT {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ribotish:0.2.7--pyhdfd78af_0':
'quay.io/biocontainers/ribotish:0.2.7--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/ribotish:0.2.8--pyhdfd78af_0':
'quay.io/biocontainers/ribotish:0.2.8--pyhdfd78af_0' }"

input:
tuple val(meta), path(bam_ribo), path(bai_ribo)
Expand All @@ -14,19 +14,21 @@ process RIBOTISH_PREDICT {
tuple val(meta4), path(candidate_orfs)
tuple val(meta5), path(para_ribo)
tuple val(meta6), path(para_ti)
tuple val(meta7), path(reference_gtf, stageAs: 'secondary.gtf')

output:
tuple val(meta), path("*_pred.txt") , emit: predictions
tuple val(meta), path("*_all.txt") , emit: all
tuple val(meta), path("*_transprofile.py") , emit: transprofile
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('ribotish'), eval("ribotish --version | sed 's/ribotish //'"), topic: versions, emit: versions_ribotish

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

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

ribo_bam_cmd = ''
ti_bam_cmd = ''
Expand All @@ -48,16 +50,12 @@ process RIBOTISH_PREDICT {
$ti_bam_cmd \\
-f $fasta \\
-g $gtf \\
$reference_gtf_arg \\
-o ${prefix}_pred.txt \\
--allresult ${prefix}_all.txt \\
--transprofile ${prefix}_transprofile.py \\
-p $task.cpus \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ribotish: \$(ribotish --version | sed 's/ribotish //')
END_VERSIONS
"""

stub:
Expand All @@ -66,10 +64,5 @@ process RIBOTISH_PREDICT {
touch ${prefix}_pred.txt
touch ${prefix}_all.txt
touch ${prefix}_transprofile.py

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ribotish: \$(ribotish --version | sed 's/ribotish //')
END_VERSIONS
"""
}
50 changes: 38 additions & 12 deletions modules/nf-core/ribotish/predict/meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "ribotish_predict"
description: Quality control of riboseq bam data
keywords:
Expand All @@ -13,9 +12,9 @@ tools:
documentation: "https://github.com/zhpn1024/ribotish"
tool_dev_url: "https://github.com/zhpn1024/ribotish"
doi: "10.1038/s41467-017-01981-8"
licence: ["GPL v3"]
licence:
- "GPL v3"
identifier: ""

input:
- - meta:
type: map
Expand Down Expand Up @@ -85,7 +84,7 @@ input:
Input P-site offset parameter files for riboseq bam files
pattern: "*.py"
ontologies:
- edam: http://edamontology.org/format_3996 # Python script
- edam: http://edamontology.org/format_3996
- - meta6:
type: map
description: |
Expand All @@ -97,7 +96,20 @@ input:
Input P-site offset parameter files for TI-seq bam files
pattern: "*.py"
ontologies:
- edam: http://edamontology.org/format_3996 # Python script
- edam: http://edamontology.org/format_3996
- - meta7:
type: map
description: |
Groovy Map containing reference information for the secondary
annotation file
- reference_gtf:
type: file
description: |
Optional secondary GTF annotation passed to ribotish as
`-a <reference-annotation>` (e.g. a MANE/RefSeq overlay applied on
top of the primary GTF). Pass `[]` to omit.
pattern: "*.gtf"
ontologies: []
output:
predictions:
- - meta:
Expand Down Expand Up @@ -137,14 +149,28 @@ output:
positions on transcript.
pattern: "*.{py}"
ontologies:
- edam: http://edamontology.org/format_3996 # Python script
- edam: http://edamontology.org/format_3996
versions_ribotish:
- - ${task.process}:
type: string
description: The name of the process
- ribotish:
type: string
description: The name of the tool
- ribotish --version | sed 's/ribotish //':
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- ribotish:
type: string
description: The name of the tool
- ribotish --version | sed 's/ribotish //':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@pinin4fjords"
maintainers:
Expand Down
36 changes: 24 additions & 12 deletions modules/nf-core/ribotish/predict/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ nextflow_process {
input[3] = Channel.of([[],[]])
input[4] = Channel.of([[],[]])
input[5] = Channel.of([[],[]])
input[6] = Channel.of([[],[]])
"""
}
}
Expand All @@ -52,8 +53,10 @@ nextflow_process {
{ assert process.success },
{ assert path(process.out.predictions[0][1]).getText().contains("ENSG00000132640\tENST00000254977\tBTBD3\tprotein_coding\t20:11890767-11923666:+\tATG\t45\t1743\tExtended\t0\t0\tNone\t0.013377070461772932\tT\tNone\tNone\t0.02118962148347") },
{ assert path(process.out.all[0][1]).getText().contains("ENSG00000132640\tENST00000254977\tBTBD3\tprotein_coding\t20:11890767-11923666:+\tATG\t45\t1743\tExtended\t0\t0\tNone\t0.013377070461772932\tT\tNone\tNone\t0.02118962148347") },
{ assert snapshot(process.out.transprofile).match("transprofile_single_end_single_ribo_bam") },
{ assert snapshot(process.out.versions).match("versions_single_end_single_ribo_bam") }
{ assert snapshot(
process.out.transprofile,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}
}
Expand All @@ -79,17 +82,20 @@ nextflow_process {
input[3] = Channel.of([[],[]])
input[4] = Channel.of([[],[]])
input[5] = Channel.of([[],[]])
input[6] = Channel.of([[],[]])
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.predictions).match("predictions_single_end_single_ribo_bam_stub") },
{ assert snapshot(process.out.all).match("all_single_end_single_ribo_bam_stub") },
{ assert snapshot(process.out.transprofile).match("transprofile_single_end_single_ribo_bam_stub") },
{ assert snapshot(process.out.versions).match("versions_single_end_single_ribo_bam_stub") }
{ assert snapshot(
process.out.predictions,
process.out.all,
process.out.transprofile,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}
}
Expand Down Expand Up @@ -119,6 +125,7 @@ nextflow_process {
input[3] = Channel.of([[],[]])
input[4] = Channel.of([[],[]])
input[5] = Channel.of([[],[]])
input[6] = Channel.of([[],[]])
"""
}
}
Expand All @@ -128,8 +135,10 @@ nextflow_process {
{ assert process.success },
{ assert path(process.out.predictions[0][1]).getText().contains("ENSG00000284776\tENST00000618693\t\tprotein_coding\t20:18567478-18744216:+\tATG\t26\t695\tAnnotated\t0\t0\tNone\t0.0006123183014212") },
{ assert path(process.out.all[0][1]).getText().contains("ENSG00000284776\tENST00000618693\t\tprotein_coding\t20:18567478-18744216:+\tATG\t26\t695\tAnnotated\t0\t0\tNone\t0.0006123183014212") },
{ assert snapshot(process.out.transprofile).match("transprofile_single_end_multi_ribo_bam") },
{ assert snapshot(process.out.versions).match("versions_single_end_multi_ribo_bam") }
{ assert snapshot(
process.out.transprofile,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}
}
Expand Down Expand Up @@ -161,17 +170,20 @@ nextflow_process {
input[3] = Channel.of([[],[]])
input[4] = Channel.of([[],[]])
input[5] = Channel.of([[],[]])
input[6] = Channel.of([[],[]])
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.predictions).match("predictions_single_end_multi_ribo_bam_stub") },
{ assert snapshot(process.out.all).match("all_single_end_multi_ribo_bam_stub") },
{ assert snapshot(process.out.transprofile).match("transprofile_single_end_multi_ribo_bam_stub") },
{ assert snapshot(process.out.versions).match("versions_single_end_multi_ribo_bam_stub") }
{ assert snapshot(
process.out.predictions,
process.out.all,
process.out.transprofile,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}
}
Expand Down
Loading
Loading