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
7 changes: 7 additions & 0 deletions modules/nf-core/plastid/make_wiggle/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:
- plastid=0.6.1
68 changes: 68 additions & 0 deletions modules/nf-core/plastid/make_wiggle/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
process PLASTID_MAKE_WIGGLE {
tag "$meta.id"
label "process_single"

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/plastid:0.6.1--py39had3e4b6_2':
'biocontainers/plastid:0.6.1--py39had3e4b6_2' }"

input:
tuple val(meta), path(bam), path(bam_index), path(p_offsets)
val(mapping_rule)

output:
tuple val(meta), path("*.{wig,bedgraph}"), emit: tracks
path "versions.yml" , emit: versions

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

script:
if (mapping_rule == 'fiveprime_variable' && !p_offsets) {
error "p_offsets file is required when using mapping_rule 'fiveprime_variable'"
}
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ""
def offset_arg = mapping_rule == 'fiveprime_variable' ? "--offset $p_offsets" : ""
def extension = args.contains('--output_format bedgraph') ? "bedgraph" : "wig"
def VERSION = "0.6.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
make_wiggle \\
--count_files "$bam" \\
$offset_arg \\
--${mapping_rule} \\
-o "$prefix" \\
$args

if [ "$extension" = "bedgraph" ]; then
for FILE in *.wig; do
mv "\$FILE" "\${FILE%.wig}.bedgraph"
done
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plastid: $VERSION
END_VERSIONS
"""

stub:
if (mapping_rule == 'fiveprime_variable' && !p_offsets) {
error "p_offsets file is required when using mapping_rule 'fiveprime_variable'"
}
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ""
def extension = args.contains('--output_format bedgraph') ? "bedgraph" : "wig"
def VERSION = "0.6.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}_fw.${extension}
touch ${prefix}_rc.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plastid: $VERSION
END_VERSIONS
"""
}
77 changes: 77 additions & 0 deletions modules/nf-core/plastid/make_wiggle/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "plastid_make_wiggle"
description: Create wiggle or bedGraph files from alignment files after applying
a read mapping rule (e.g. to map ribosome-protected footprints at their
P-sites), for visualization in a genome browser
keywords:
- genomics
- riboseq
- psite
- wiggle
- bedgraph
tools:
- "plastid":
description: "Nucleotide-resolution analysis of next-generation sequencing and
genomics data"
homepage: "https://github.com/joshuagryphon/plastid"
documentation: "https://plastid.readthedocs.io/en/latest/"
tool_dev_url: "https://github.com/joshuagryphon/plastid"
doi: "10.1186/s12864-016-3278-x"
licence: ["BSD-3-clause"]
identifier: biotools:plastid

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- bam:
type: file
description: Genome BAM file
pattern: "*.bam"
ontologies:
- edam: http://edamontology.org/format_2572 # BAM
- bam_index:
type: file
description: Genome BAM index file
pattern: "*.bai"
ontologies:
- edam: http://edamontology.org/format_3327 # BAI
- p_offsets:
type: file
description: |
Selected p-site offset for each read length (output from plastid_psite).
Required when mapping_rule is 'fiveprime_variable', otherwise pass empty list [].
pattern: "*_p_offsets.txt"
ontologies: []
- mapping_rule:
type: string
description: |
Read mapping rule. Use 'fiveprime_variable' with p_offsets file to map reads to P-sites.
enum: ["fiveprime", "threeprime", "center", "fiveprime_variable"]
output:
tracks:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.{wig,bedgraph}":
type: file
description: wig/bedgraph tracks for forward and reverse strands
pattern: "*.{wig,bedgraph}"
ontologies:
- edam: http://edamontology.org/format_3005 # wig
- edam: http://edamontology.org/format_3583 # bedgraph
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@suhrig"
maintainers:
- "@suhrig"
65 changes: 65 additions & 0 deletions modules/nf-core/plastid/make_wiggle/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// nf-core modules test plastid
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "plastid"
tag "plastid/make_wiggle"

test("human chr20 bam - fiveprime_variable") {

when {
process {
"""
input[0] = [
[ id:'SRX11780887' ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887_chr20.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887_chr20.bam.bai", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/plastid/SRX11780887_p_offsets.txt", checkIfExists: true)
]
input[1] = 'fiveprime_variable'
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.tracks.get(0).get(1).get(0)).getText().contains('track') },
{ assert snapshot(process.out.versions).match() }
)
}
}

test("human chr20 bam - fiveprime_variable - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'SRX11780887' ], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887_chr20.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887_chr20.bam.bai", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/plastid/SRX11780887_p_offsets.txt", checkIfExists: true)
]
input[1] = 'fiveprime_variable'
"""
}
}

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

}
26 changes: 26 additions & 0 deletions modules/nf-core/plastid/make_wiggle/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"human chr20 bam - fiveprime_variable": {
"content": [
[
"versions.yml:md5,4ecd455575ab11a0ad86dc5e0a6c6959"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.10.0"
},
"timestamp": "2025-12-10T12:36:00.352824"
},
"human chr20 bam - fiveprime_variable - stub": {
"content": [
[
"versions.yml:md5,4ecd455575ab11a0ad86dc5e0a6c6959"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.10.0"
},
"timestamp": "2025-12-10T12:26:10.353895"
}
}
7 changes: 7 additions & 0 deletions modules/nf-core/plastid/metagene_generate/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:
- plastid=0.6.1
48 changes: 48 additions & 0 deletions modules/nf-core/plastid/metagene_generate/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process PLASTID_METAGENE_GENERATE {
tag "$annotation"
label "process_low"

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/plastid:0.6.1--py39had3e4b6_2':
'biocontainers/plastid:0.6.1--py39had3e4b6_2' }"

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

output:
tuple val(meta), path("*_rois.txt"), emit: rois_txt
tuple val(meta), path("*_rois.bed"), emit: rois_bed
path "versions.yml", emit: versions

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

script:
def args = task.ext.args ?: ''
def VERSION = "0.6.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
metagene generate \\
"${annotation.baseName}" \\
--annotation_files "$annotation" \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plastid: $VERSION
END_VERSIONS
"""

stub:
def VERSION = "0.6.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${annotation.baseName}_rois.txt
touch ${annotation.baseName}_rois.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plastid: $VERSION
END_VERSIONS
"""
}
72 changes: 72 additions & 0 deletions modules/nf-core/plastid/metagene_generate/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "plastid_metagene_generate"
description: Compute a metagene profile of read alignments, counts, or
quantitative data over one or more regions of interest, optionally
applying a mapping rule
keywords:
- genomics
- riboseq
- psite
tools:
- "plastid":
description: "Nucleotide-resolution analysis of next-generation sequencing and genomics data"
homepage: "https://github.com/joshuagryphon/plastid"
documentation: "https://plastid.readthedocs.io/en/latest/"
tool_dev_url: "https://github.com/joshuagryphon/plastid"
doi: "10.1186/s12864-016-3278-x"
licence: ["BSD-3-clause"]
identifier: biotools:plastid

input:
- - meta:
type: map
description: |
Map containing reference information for the reference genome annotation file
e.g. `[ id:'Ensembl human v.111' ]`
- annotation:
type: file
description: annotation file of reference genome (BED, bigBed, GTF, GFF3)
pattern: "*.{bed,bigbed,gtf,gff3}"
ontologies:
- edam: http://edamontology.org/format_3003 # BED
- edam: http://edamontology.org/format_3004 # bigBed
- edam: http://edamontology.org/format_2306 # GTF
- edam: http://edamontology.org/format_1975 # GFF3
output:
rois_txt:
- - meta:
type: map
description: |
Map containing reference information for the reference genome annotation file
e.g. `[ id:'Ensembl human v.111' ]`
- "*_rois.txt":
type: file
description: Tab-delimited text file describing the maximal spanning
window for each gene
pattern: "*_rois.txt"
ontologies: []
rois_bed:
- - meta:
type: map
description: |
Map containing reference information for the reference genome annotation file
e.g. `[ id:'Ensembl human v.111' ]`
- "*_rois.bed":
type: file
description: |
Maximal spanning windows in BED format for visualization in a genome
browser. The thickly-rendered portion of a window indicates its landmark.
pattern: "*_rois.bed"
ontologies:
- edam: http://edamontology.org/format_3003 # BED
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@suhrig"
maintainers:
- "@suhrig"
Loading
Loading