-
Notifications
You must be signed in to change notification settings - Fork 958
RiboCode - prepare_transcripts, metaplots, ribocode #9485
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 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1d7c518
add 3 required ribocode modules
JackCurragh e33ba2d
GTFUpdate; meta in inputs; No Gzip;
JackCurragh bf21e3b
return snaps
JackCurragh 2d29a9e
nf-test passing
JackCurragh 38c38c0
Merge branch 'master' into add-ribocode-modules
pinin4fjords f3b6e88
Update RiboCode versions to use topics
JackCurragh 70de464
Update RiboCode versions to use topics -New lines at EOF
JackCurragh 2aabecf
Update RiboCode versions to use topics - Prettier
JackCurragh 5d6804b
RiboCode update snapshots
JackCurragh e722c60
Update RiboCode snapshots to container versions
JackCurragh 81a245d
Bump to latest ribocode build with pyfasta and ribocode fixes
pinin4fjords fbcf942
Improve RiboCode module tests and fix review issues
pinin4fjords 449a469
Update RiboCode snapshot to GHA runner architecture
pinin4fjords 40adf14
Add schema reference to ribocode/ribocode meta.yml
pinin4fjords f31976d
Revert nf-test.config to standard test-datasets paths
pinin4fjords 583ca70
Merge branch 'master' into add-ribocode-modules
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,6 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| - defaults | ||
| dependencies: | ||
| - bioconda::ribocode=1.2.15 |
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,50 @@ | ||
| process RIBOCODE_METAPLOTS { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': | ||
| 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(bam) | ||
| path annotation | ||
|
|
||
| output: | ||
| tuple val(meta), path("*config.txt") , emit: config | ||
| tuple val(meta), path("*.pdf") , emit: pdf | ||
| path "versions.yml" , emit: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| metaplots \\ | ||
| -a $annotation \\ | ||
| -r $bam \\ | ||
| -o ${prefix} \\ | ||
| $args | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| RiboCode: \$(RiboCode --version 2>&1) | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}_config.txt | ||
| touch ${prefix}_report.pdf | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| RiboCode: \$(echo "1.2.15") | ||
| 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,64 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json | ||
| name: "ribocode_metaplots" | ||
| description: Set up RiboCode ORF calling with metaplots | ||
| keywords: | ||
| - Ribo-Seq | ||
| - Ribosome Profiling | ||
| - ORF Calling | ||
| tools: | ||
| - "ribocode": | ||
| description: "A package for detecting the actively translated ORFs using ribosome-profiling | ||
| data" | ||
| homepage: "https://github.com/xryanglab/RiboCode" | ||
| documentation: "https://github.com/xryanglab/RiboCode" | ||
| tool_dev_url: "https://github.com/xryanglab/RiboCode" | ||
| doi: "10.1093/nar/gky179" | ||
| licence: ["MIT"] | ||
| identifier: "" | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'test', single_end:false ]` | ||
| - bam: | ||
| type: file | ||
| description: Sorted BAM/CRAM/SAM file | ||
| pattern: "*.{bam,cram,sam}" | ||
| ontologies: [] | ||
| - annotation: | ||
| type: directory | ||
| description: Directory containing annotation files | ||
| pattern: "annotation" | ||
|
|
||
| output: | ||
| config: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'test', single_end:false ]` | ||
| - "*config.txt": | ||
| type: file | ||
| description: RiboCode configuration file containing P-site offsets | ||
| pattern: "*_config.txt" | ||
| ontologies: [] | ||
| pdf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'test', single_end:false ]` | ||
| - "*.pdf": | ||
| type: file | ||
| description: PDF file containing P-site metaplots for quality control | ||
| pattern: "*_report.pdf" | ||
| ontologies: [] | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| authors: | ||
| - "@JackCurragh" |
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,51 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process RIBOCODE_METAPLOTS" | ||
| script "../main.nf" | ||
| process "RIBOCODE_METAPLOTS" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "ribocode" | ||
| tag "ribocode/metaplots" | ||
| tag "ribocode/prepare" | ||
|
|
||
| setup { | ||
| run("RIBOCODE_PREPARE") { | ||
| script "../../prepare/main.nf" | ||
| process { | ||
|
|
||
| """ | ||
| input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) | ||
| input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("test_ribocode_metaplots") { | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], | ||
| file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887.Aligned.toTranscriptome.out.bam", checkIfExists: true) | ||
| ] | ||
| input[1] = RIBOCODE_PREPARE.out.annotation | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
55 changes: 55 additions & 0 deletions
55
modules/nf-core/ribocode/metaplots/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,55 @@ | ||
| { | ||
| "test_ribocode_metaplots": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": false | ||
| }, | ||
| "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" | ||
| ] | ||
| ], | ||
| "1": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": false | ||
| }, | ||
| "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" | ||
| ] | ||
| ], | ||
| "2": [ | ||
| "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" | ||
| ], | ||
| "config": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": false | ||
| }, | ||
| "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" | ||
| ] | ||
| ], | ||
| "pdf": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": false | ||
| }, | ||
| "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" | ||
| ] | ||
| ], | ||
| "versions": [ | ||
| "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" | ||
| ] | ||
| } | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.0" | ||
| }, | ||
| "timestamp": "2025-12-01T15:29:32.897378" | ||
| } | ||
| } |
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,5 @@ | ||
| process { | ||
| withName: RIBOCODE_METAPLOTS { | ||
| ext.args = '-f0_percent 0.1 -pv1 1 -pv2 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,6 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| - defaults | ||
| dependencies: | ||
| - bioconda::ribocode=1.2.15 |
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,64 @@ | ||
| process RIBOCODE_PREPARE { | ||
| tag "$fasta" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': | ||
| 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" | ||
|
|
||
| input: | ||
| path fasta | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| path gtf | ||
|
|
||
| output: | ||
| path "annotation" , emit: annotation | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| path "versions.yml" , emit: versions | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
|
|
||
| """ | ||
| # nf-core: ensure FASTA is uncompressed | ||
| GENOME="$fasta" | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [[ "\$GENOME" == *.gz ]]; then | ||
| gunzip -c "\$GENOME" > genome.fa | ||
| GENOME="genome.fa" | ||
| fi | ||
|
|
||
| # Update the GTF | ||
| GTFupdate \\ | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $gtf \\ | ||
| > updated.gtf | ||
|
|
||
| # Run prepare_transcripts with uncompressed FASTA | ||
| prepare_transcripts \\ | ||
| -g updated.gtf \\ | ||
| -f "\$GENOME" \\ | ||
| -o annotation | ||
|
||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| RiboCode: \$(RiboCode --version) | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
|
|
||
| """ | ||
| mkdir annotation | ||
|
|
||
| touch annotation/transcripts_cds.txt | ||
| touch annotation/transcripts_sequence.fa | ||
| touch annotation/transcripts.pickle | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
|
||
| "${task.process}": | ||
| RiboCode: \$(echo "1.2.15") | ||
| 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,45 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json | ||
| name: "ribocode_prepare" | ||
| description: Prepare the annotation files for RiboCode ORF calling | ||
| keywords: | ||
| - Ribo-Seq | ||
| - Ribosome Profiling | ||
| - ORF calling | ||
| tools: | ||
| - "ribocode": | ||
| description: "A package for detecting the actively translated ORFs using ribosome-profiling | ||
| data" | ||
| homepage: "https://github.com/xryanglab/RiboCode" | ||
| documentation: "https://github.com/xryanglab/RiboCode" | ||
| tool_dev_url: "https://github.com/xryanglab/RiboCode" | ||
| doi: "10.1093/nar/gky179" | ||
| licence: ["MIT"] | ||
| identifier: "" | ||
|
|
||
| input: | ||
| - fasta: | ||
JackCurragh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: file | ||
| description: Reference genome FASTA file | ||
| pattern: "*.{fasta,fa,fna}" | ||
| ontologies: [] | ||
| - gtf: | ||
| type: file | ||
| description: Reference genome GTF annotation file | ||
| pattern: "*.{gtf}" | ||
|
|
||
| ontologies: [] | ||
| output: | ||
| annotation: | ||
| - annotation: | ||
| type: directory | ||
| description: Directory containing RiboCode annotation files | ||
| (transcripts_cds.txt, transcripts_sequence.fa, transcripts.pickle) | ||
| pattern: "annotation/" | ||
|
|
||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| authors: | ||
| - "@JackCurragh" | ||
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,32 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process RIBOCODE_PREPARE" | ||
| script "../main.nf" | ||
| process "RIBOCODE_PREPARE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "ribocode" | ||
| tag "ribocode/prepare" | ||
|
|
||
| test("test_ribocode_prepare") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) | ||
| input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
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.