-
Notifications
You must be signed in to change notification settings - Fork 1k
Add paraphrase #10273
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
Add paraphrase #10273
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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,10 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - conda-forge::pip==26.0.1 | ||
| - conda-forge::python=3.14.3 | ||
| - pip: | ||
| - paraphrase==0.2.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,48 @@ | ||
| process PARAPHRASE { | ||
| 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/bc/bc177b8e7e1d9bbdcbb64a6ad630c7ecc63a2229ce2b219408888bc2bb34cac3/data': | ||
| 'community.wave.seqera.io/library/pip_paraphrase:59a4576966ee5f0b' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(jsons), val(samples) | ||
| tuple val(meta2), path(yaml) | ||
| val(tsv_output) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.json"), emit: json, optional: true | ||
| tuple val(meta), path("*.tsv"), emit: tsv, optional: true | ||
|
|
||
| tuple val("${task.process}"), val('paraphrase'), eval("paraphrase --version"), topic: versions, emit: versions_paraphrase | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def rules = yaml ? "--rules $yaml" : '' | ||
| def output_format = tsv_output ? 'tsv' : 'json' | ||
| """ | ||
| paraphrase \ | ||
| $args \ | ||
| --input ${jsons.join(' --input ')} \ | ||
| --sample ${samples.join(' --sample ')} \ | ||
| --output-format=${output_format} \ | ||
| $rules \ | ||
| > ${prefix}.${output_format} | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def output_format = tsv_output ? 'tsv' : 'json' | ||
| """ | ||
| echo $args | ||
|
|
||
| touch ${prefix}.${output_format} | ||
| """ | ||
| } |
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,87 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "paraphrase" | ||
| description: Parse and annotate paraphrase JSONs | ||
| keywords: | ||
| - long-read | ||
| - paraphrase | ||
| - annotate | ||
| tools: | ||
| - "paraphrase": | ||
| description: "Paraphase JSON parser" | ||
| homepage: "https://github.com/Clinical-Genomics/paraphrase" | ||
| documentation: "https://github.com/Clinical-Genomics/paraphrase/README.md" | ||
| tool_dev_url: "https://github.com/Clinical-Genomics/paraphrase" | ||
| licence: ["MIT"] | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1']` | ||
| - jsons: | ||
| type: file | ||
| description: "One or more JSON files from paraphase" | ||
| pattern: "*.json" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 # JSON | ||
| - samples: | ||
| type: list | ||
| description: "Sample names corresponding to the JSON files. Must be in the same order as the JSON files." | ||
| - - meta2: | ||
| type: map | ||
| description: Groovy Map containing reference information. | ||
| - yaml: | ||
| type: file | ||
| description: "YAML file containing rules for annotation" | ||
| pattern: "*.yaml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3473 # YAML | ||
| - tsv_output: | ||
| type: boolean | ||
| description: "Whether to output in TSV format instead of JSON. Default is false (JSON output)." | ||
|
|
||
| output: | ||
| json: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1']` | ||
| - "*.json": | ||
| type: file | ||
| description: "Annotated output in JSON format" | ||
| pattern: "*.json" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 # JSON | ||
| tsv: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information. e.g. `[ id:'sample1']` | ||
| - "*.tsv": | ||
| type: file | ||
| description: "Annotated output in TSV format" | ||
| pattern: "*.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 # TSV | ||
| versions_paraphrase: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - paraphrase: | ||
| type: string | ||
| description: The name of the tool | ||
| - paraphrase --version: | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - paraphrase: | ||
| type: string | ||
| description: The name of the tool | ||
| - paraphrase --version: | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@fellen31" | ||
| maintainers: | ||
| - "@fellen31" |
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,123 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PARAPHRASE" | ||
| script "../main.nf" | ||
| process "PARAPHRASE" | ||
| config "./nextflow.config" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "tabix/bgzip" | ||
| tag "paraphase" | ||
| tag "paraphrase" | ||
|
|
||
| setup { | ||
| run("TABIX_BGZIP") { | ||
| script "../../tabix/bgzip/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test_ref' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
| run("PARAPHASE") { | ||
| script "../../paraphase/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:true ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), | ||
| ] | ||
| input[1] = TABIX_BGZIP.out.output | ||
| input[2] = [ | ||
| [:], | ||
| [] | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("no rules") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--gene PRODH' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = PARAPHASE.out.json.map { meta, json -> [meta, json, meta.id] } | ||
| input[1] = [[],[]] | ||
| input[2] = false | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot(process.out).match() } | ||
|
fellen31 marked this conversation as resolved.
Outdated
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("rules") { | ||
|
fellen31 marked this conversation as resolved.
Outdated
|
||
|
|
||
| when { | ||
| params { | ||
| module_args = '--gene PRODH' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = PARAPHASE.out.json.map { meta, json -> [meta, json, meta.id] } | ||
| input[1] = [ | ||
| [ id:'rules' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/yaml/rules.yaml', checkIfExists: true) | ||
| ] | ||
| input[2] = false | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("rules - tsv output") { | ||
|
fellen31 marked this conversation as resolved.
Outdated
|
||
|
|
||
| when { | ||
| params { | ||
| module_args = '--gene PRODH' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = PARAPHASE.out.json.map { meta, json -> [meta, json, meta.id] } | ||
| input[1] = [ | ||
| [ id:'rules' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/yaml/rules.yaml', checkIfExists: true) | ||
| ] | ||
| input[2] = true | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
|
fellen31 marked this conversation as resolved.
|
||
| } | ||
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.