-
Notifications
You must be signed in to change notification settings - Fork 1k
Rmats prep PR #10128
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
Open
akaviaLab
wants to merge
24
commits into
nf-core:master
Choose a base branch
from
akaviaLab:rmats
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+677
−0
Open
Rmats prep PR #10128
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5ccd85b
Initial commit that passes pre-commit hooks, trying minimal parameter…
akaviaLab 4f2ad83
Initial version of rmats prep task correctly using args
akaviaLab b1ca50f
fixed some minor problems
akaviaLab 413229d
updated meta.yml for rmats prep task
akaviaLab 7e11e0a
Added read outcome file to output
akaviaLab c85ce8e
Added test config with args, and removed some TODOs
akaviaLab dd0443f
Trying to use topics
akaviaLab 7957efd
fix version section of meta.yml
mashehu eb7662b
fix patterns
mashehu 5150e5f
meta.yml that works with topics
akaviaLab c985940
Deleted unnecessary file
akaviaLab a772926
rmats prep test works as exepcted for rnasplice files
akaviaLab 028d1c6
Added tests for all parameters of rmats
akaviaLab 86c8a8c
Remoevd TODO lines from main.nf
akaviaLab 5b92e0a
Changes as part of the review
akaviaLab 4c4cfdc
Merge branch 'master' into rmats
SPPearce 6bf74a8
Apply suggestions from code review
akaviaLab 7e0ba25
Merge branch 'master' into rmats
SPPearce feab635
Meta2 is present in meta.yml
akaviaLab b2125d3
Tests should work now
akaviaLab aac887c
Merge branch 'master' into rmats
akaviaLab f4499da
Applied suggestions from code review
akaviaLab 3313092
Merge branch 'master' into rmats
akaviaLab e43f365
Renamed output read_outcomes in tests
akaviaLab 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: | ||
| - "bioconda::rmats=4.3.0" |
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,52 @@ | ||
| process RMATS_PREP { | ||
| 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/rmats:4.3.0--py311hf2f0b74_5' | ||
| : 'biocontainers/rmats:4.3.0--py311hf2f0b74_5'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(genome_bam) | ||
| tuple val(meta2), path(reference_gtf) | ||
| val read_length | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.rmats"), emit: rmats | ||
| tuple val(meta), path("*read_outcomes_by_bam.txt"), emit: read_outcomes | ||
| tuple val("${task.process}"), val('rmats'), eval('rmats.py --version | sed -e "s/v//g"'), emit: versions_rmats, topic: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| echo ${genome_bam} > ${prefix}.prep.b1.txt | ||
|
|
||
| rmats.py \\ | ||
| --task prep \\ | ||
| ${args} \\ | ||
| --nthread ${task.cpus} \\ | ||
| --b1 ${prefix}.prep.b1.txt \\ | ||
| --gtf ${reference_gtf} \\ | ||
| --readLength ${read_length} \\ | ||
| --tmp ${prefix}_rmats_tmp \\ | ||
| --od ${prefix}_rmats_prep | ||
|
|
||
| cp ${prefix}_rmats_tmp/*.txt ${prefix}_read_outcomes_by_bam.txt | ||
| cp ${prefix}_rmats_tmp/*.rmats ${prefix}.rmats | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| echo ${args} | ||
|
|
||
| touch ${prefix}.rmats | ||
| touch ${prefix}_read_outcomes_by_bam.txt | ||
| """ | ||
| } | ||
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,92 @@ | ||
| name: "rmats_prep" | ||
| description: MATS is a computational tool to detect differential alternative | ||
| splicing events from RNA-Seq data. | ||
| keywords: | ||
| - splicing | ||
| - RNA-Seq | ||
| - alternative splicing | ||
| - exon | ||
| - intron | ||
| - rMATS | ||
| tools: | ||
| - "rmats": | ||
| description: "MATS is a computational tool to detect differential alternative | ||
| splicing events from RNA-Seq data." | ||
| homepage: "https://github.com/Xinglab/rmats-turbo" | ||
| documentation: "https://github.com/Xinglab/rmats-turbo/blob/v4.3.0/README.md" | ||
| doi: "10.1038/s41596-023-00944-2" | ||
| licence: | ||
| - "FreeBSD for non-commercial use, see LICENSE file" | ||
| identifier: biotools:rmats | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ | ||
| id:'sample1', single_end:false, strandness:'auto']` | ||
| - genome_bam: | ||
| type: file | ||
| description: BAM file aligned to the genome | ||
| pattern: "*.{bam}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_2572 | ||
| - - meta2: | ||
| type: map | ||
| description: Groovy Map containing genome information | ||
| - reference_gtf: | ||
| type: file | ||
| description: Annotation GTF file | ||
| pattern: "*.{gtf}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_2306 | ||
| - read_length: | ||
| type: integer | ||
| description: Read length in bases | ||
| output: | ||
| rmats: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ | ||
| id:'sample1'single_end:false, strandness:'auto']` | ||
| - "*.rmats": | ||
| type: file | ||
| description: rmats junction count information, after processing the BAM | ||
| file | ||
| pattern: "*.rmats" | ||
| ontologies: [] | ||
| read_outcomes: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ | ||
| id:'sample1'single_end:false, strandness:'auto']` | ||
| - "*read_outcomes_by_bam.txt": | ||
| type: file | ||
| description: text file detailing number of reads used and not used for | ||
| various reasons (clipped, not paired, wrong length, etc.) | ||
| pattern: "*read_outcomes_by_bam.txt" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_2330 | ||
| versions_rmats: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - rmats: | ||
| type: string | ||
| description: The tool name | ||
| - rmats.py --version | sed -e "s/v//g": | ||
| type: eval | ||
| description: The command used to generate the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - rmats: | ||
| type: string | ||
| description: The tool name | ||
| - rmats.py --version | sed -e "s/v//g": | ||
| type: eval | ||
| description: The command used to generate the version of the tool | ||
| authors: | ||
| - "@akaviaLab" | ||
| maintainers: | ||
| - "@akaviaLab" |
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,237 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process RMATS_PREP" | ||
| script "../main.nf" | ||
| process "RMATS_PREP" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "rmats" | ||
| tag "rmats/prep" | ||
|
|
||
| test("homo_sapiens - paired unstranded rmats prep") { | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"unstranded" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| def reads_clipped = lines[9] =~ /CLIPPED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 }, | ||
| { assert reads_clipped[0][1] as Integer == 0 } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - single-end unstranded rmats prep") { | ||
|
|
||
| config "./nextflow.config" | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:true, strandness:"unstranded" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - paired forward rmats prep") { | ||
|
|
||
| config "./nextflow.config" | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"forward" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - paired reverse rmats prep") { | ||
|
|
||
| config "./nextflow.config" | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"reverse" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - paired unstranded novel splice rmats prep") { | ||
|
|
||
| config "./nextflow.config" | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"unstranded" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| params { | ||
| novel_splice_site = true | ||
| minimum_intron_length = 48 | ||
| max_exon_length = 488 | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - paired unstranded no clipping rmats prep") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"unstranded" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| def lines = path(process.out.read_outcomes[0][1]).readLines() | ||
| def reads_used = lines[1] =~ /USED: (\d+)/ | ||
| def reads_clipped = lines[9] =~ /CLIPPED: (\d+)/ | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| { assert reads_used[0][1] as Integer > 0 }, | ||
| { assert reads_clipped[0][1] as Integer > 0}, | ||
| { assert reads_clipped[0][1] as Integer > reads_used[0][1] as Integer } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - prep - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false, strandness:"unstranded" ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), | ||
| ] | ||
| input[1] = [ | ||
| [id: 'hg38'], // meta2 map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) | ||
| ] | ||
| input[2] = 150 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(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.