-
Notifications
You must be signed in to change notification settings - Fork 1k
Add new module: saltshaker/classify #10914
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
22 commits
Select commit
Hold shift + click to select a range
7ebe536
add saltshaker classify module and tests
6438574
pin pip version
eff22ac
add saltshaker classify module and tests
c6e9de7
pin pip version
eb6312b
update test with nf-core saltshaker/call
0f2d859
merge
8aec224
fix linting
295bafd
Merge branch 'master' into saltshaker_classify
ieduba 60dd84b
add saltshaker classify module and tests
084eb60
pin pip version
3645159
update test with nf-core saltshaker/call
2bc1be9
fix linting
507b6f9
edits from review
70625c9
merge
dd22a55
Merge branch 'master' into saltshaker_classify
ieduba 146cdf6
update snaps and meta.yml
40b1cad
Merge branch 'saltshaker_classify' of github.com:ieduba/modules into …
fc96472
Merge branch 'master' into saltshaker_classify
ieduba 8848338
only make vcf in stub if vcf is in args
13e6811
Merge branch 'saltshaker_classify' of github.com:ieduba/modules into …
631f22f
add no-vcf tests
ff7a166
Merge branch 'master' into saltshaker_classify
ieduba 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 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - pip==26.0.1 | ||
| - pip: | ||
| - saltshaker==1.0.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,56 @@ | ||
| process SALTSHAKER_CLASSIFY { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e9/e93d703b195dd27cd920cee46669d3f51043216c12fd05168c937e93adf170e8/data': | ||
| 'community.wave.seqera.io/library/pip_saltshaker:e08e38a6d45f8f32' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(call) | ||
| val dominant_fraction | ||
| val group_radius | ||
| val high_heteroplasmy | ||
| val multiple_threshold | ||
| val noise_threshold | ||
|
|
||
| output: | ||
| tuple val(meta), path("*_classify_metadata.tsv"), emit: classify | ||
| tuple val(meta), path("*_classify.txt") , emit: txt | ||
| tuple val(meta), path("*saltshaker.vcf") , emit: vcf, optional: true | ||
| tuple val("${task.process}"), val('saltshaker'), val("1.0.0"), topic: versions, emit: versions_saltshaker | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
|
||
| """ | ||
| saltshaker classify \\ | ||
| --prefix $prefix \\ | ||
| --input-dir . \\ | ||
| --dominant-fraction $dominant_fraction \\ | ||
| --radius $group_radius \\ | ||
| --high-het $high_heteroplasmy \\ | ||
| --multiple-threshold $multiple_threshold \\ | ||
| --noise $noise_threshold \\ | ||
| $args | ||
|
|
||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def touch_vcf = args.contains('--vcf') ? "touch ${prefix}.saltshaker.vcf" : '' | ||
|
|
||
| """ | ||
| echo $args | ||
|
|
||
| $touch_vcf | ||
| touch ${prefix}.saltshaker_classify.txt | ||
| touch ${prefix}.saltshaker_classify_metadata.tsv | ||
| """ | ||
| } | ||
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,106 @@ | ||
| name: "saltshaker_classify" | ||
| description: mtDNA deletion and duplication classification downstream of mitosalt | ||
| keywords: | ||
| - saltshaker | ||
| - mitosalt | ||
| - mtDNA | ||
| - structural-variant calling | ||
| tools: | ||
| - "saltshaker": | ||
| description: "A Python package for classifying and visualizing mitochondrial structural variants from MitoSAlt pipeline output." | ||
| homepage: "https://github.com/aksenia/saltshaker" | ||
| documentation: "https://github.com/aksenia/saltshaker/tree/main/saltshaker/docs" | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - call: | ||
| type: file | ||
| description: call metadata file from saltshaker_call | ||
| pattern: "*_call_metadata.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/operation_3227 #variant calling | ||
| - edam: http://edamontology.org/format_3475 #tsv | ||
| - dominant_fraction: | ||
| type: float | ||
| description: Minimum heteroplasmy fraction to classify as dominant in saltshaker | ||
| - group_radius: | ||
| type: integer | ||
| description: Spatial clustering radius for saltshaker grouping | ||
| - high_heteroplasmy: | ||
| type: float | ||
| description: High heteroplasmy threshold for saltshaker classification | ||
| - multiple_threshold: | ||
| type: float | ||
| description: Heteroplasmy threshold for multiple classification in saltshaker | ||
| - noise_threshold: | ||
| type: float | ||
| description: Heteroplasmy threshold for noise in saltshaker classification | ||
| output: | ||
| classify: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_classify_metadata.tsv": | ||
| type: file | ||
| description: tsv with classified call metadata to be used in saltshaker_plot | ||
| pattern: "*_classify_metadata.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/operation_3225 #classification | ||
| - edam: http://edamontology.org/format_3475 #tsv | ||
| txt: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*_classify.txt": | ||
| type: file | ||
| description: txt file with case classification | ||
| pattern: "*_classify.txt" | ||
| ontologies: | ||
| - edam: http://edamontology.org/operation_3225 #classification | ||
| - edam: http://edamontology.org/format_2330 #txt | ||
| vcf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*saltshaker.vcf": | ||
| type: file | ||
| description: vcf file with classified calls | ||
| pattern: "*saltshaker.vcf" | ||
| ontologies: | ||
| - edam: http://edamontology.org/operation_3225 #classification | ||
| - edam: http://edamontology.org/format_3016 #vcf | ||
| versions_saltshaker: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - saltshaker: | ||
| type: string | ||
| description: The name of the tool | ||
| - 1.0.0: | ||
| type: string | ||
| description: Hardcoded version of saltshaker used in the module | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - saltshaker: | ||
| type: string | ||
| description: The name of the tool | ||
| - 1.0.0: | ||
| type: string | ||
| description: Hardcoded version of saltshaker used in the module | ||
| authors: | ||
| - "@ieduba" | ||
| maintainers: | ||
| - "@ieduba" |
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,164 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process SALTSHAKER_CLASSIFY" | ||
| script "../main.nf" | ||
| process "SALTSHAKER_CLASSIFY" | ||
| config "./nextflow.config" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "saltshaker" | ||
| tag "saltshaker/call" | ||
| tag "saltshaker/classify" | ||
|
|
||
| setup { | ||
| run("SALTSHAKER_CALL") { | ||
| script "../../call/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mitosalt/test_mitosalt.breakpoint', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mitosalt/test_mitosalt.cluster', checkIfExists: true), | ||
| ] | ||
|
|
||
| input[1] = [ | ||
| [ id:'hg38' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/human_mt_rCRS.fasta', checkIfExists: true), | ||
| ] | ||
|
|
||
| input[2] = 15 | ||
| input[3] = 0.01 | ||
| input[4] = 16569 | ||
| input[5] = 16081 | ||
| input[6] = 407 | ||
| input[7] = 5730 | ||
| input[8] = 5763 | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("classify - vcf") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--blacklist --vcf' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = SALTSHAKER_CALL.out.call | ||
| input[1] = 0.5 | ||
| input[2] = 600 | ||
| input[3] = 10 | ||
| input[4] = 5 | ||
| input[5] = 0.3 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot( | ||
| sanitizeOutput(process.out), | ||
| ).match() } | ||
|
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("classify - vcf - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--blacklist --vcf' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = SALTSHAKER_CALL.out.call | ||
| input[1] = 0.5 | ||
| input[2] = 600 | ||
| input[3] = 10 | ||
| input[4] = 5 | ||
| input[5] = 0.3 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot( | ||
| sanitizeOutput(process.out), | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("classify - no-vcf") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--blacklist' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = SALTSHAKER_CALL.out.call | ||
| input[1] = 0.5 | ||
| input[2] = 600 | ||
| input[3] = 10 | ||
| input[4] = 5 | ||
| input[5] = 0.3 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot( | ||
| sanitizeOutput(process.out), | ||
| ).match() } | ||
|
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("classify - no-vcf - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--blacklist' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = SALTSHAKER_CALL.out.call | ||
| input[1] = 0.5 | ||
| input[2] = 600 | ||
| input[3] = 10 | ||
| input[4] = 5 | ||
| input[5] = 0.3 | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { 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.