-
Notifications
You must be signed in to change notification settings - Fork 953
plastid metagene_generate, make_wiggle, psite #9482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9a87948
plastid metagene_generate, make_wiggle, psite
suhrig fd78090
pair BAM and BAI files
suhrig 8badebb
pair bam and p_offsets
suhrig c492167
omit optional arguments
suhrig 1c91f15
metagene generate accepts various input formats
suhrig 5d48cc3
add meta
suhrig f84b0aa
do not remove variable headers from output files
suhrig bbd9682
warning about hard-coded version
suhrig 0248de3
make lint happy
suhrig d6ff886
make lint happy #2
suhrig fb8b05a
plastid/make_wiggle: nf-core standards compliance
pinin4fjords d2a760f
Merge branch 'master' into plastid
pinin4fjords 53dc06b
Merge pull request #1 from pinin4fjords/plastid-make_wiggle-fixes
suhrig 2fae818
adapt meta.yml to new parameters
suhrig c33f8b8
plastid: consolidate test snapshots and fix reproducibility
pinin4fjords bb21bc4
Merge pull request #2 from pinin4fjords/plastid-test-fixes
suhrig 554470b
plastid/make_wiggle: remove tracks from snapshot
pinin4fjords f20d354
plastid/psite: remove non-reproducible outputs from snapshot
pinin4fjords 32c987b
Merge branch 'master' into plastid
pinin4fjords File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| """ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
26
modules/nf-core/plastid/make_wiggle/tests/main.nf.test.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
suhrig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 | ||
| """ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.