-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from mskcc-omics-workflows/feature/neoantigen_…
…parse_cnvs Module phylowgs parser
- Loading branch information
Showing
9 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "phylowgsparsecnvs" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "PHYLOWGS" |
This file contains 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,46 @@ | ||
process PHYLOWGSPARSECNVS { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'docker://mskcc/phylowgs:v1.4-msk': | ||
'docker.io/mskcc/phylowgs:v1.4-msk' }" | ||
|
||
input: | ||
tuple val(meta), path(facetsgenelevel) | ||
|
||
output: | ||
tuple val(meta), path("cnvs.txt"), emit: cnv | ||
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}" | ||
|
||
""" | ||
python2 \\ | ||
/usr/bin/parser/parse_cnvs.py \\ | ||
${args} \\ | ||
${facetsgenelevel} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
phylowgsparsecnvs: \$PHYLOWGS_TAG | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch cnvs.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
phylowgsparsecnvs: \$PHYLOWGS_TAG | ||
END_VERSIONS | ||
""" | ||
} |
This file contains 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,49 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "phylowgsparsecnvs" | ||
description: parse cnvs from FACETS for input to phylowgs | ||
keywords: | ||
- phylowgs | ||
- CNVs | ||
- FACETs | ||
tools: | ||
- "phylowgsparsecnvs": | ||
description: "parser to convert FACETs output to phylowgs expected input" | ||
homepage: "https://genomebiology.biomedcentral.com/articles/10.1186/s13059-015-0602-8" | ||
tool_dev_url: "https://github.com/mskcc/phylowgs" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- facetsgenelevel: | ||
type: file | ||
description: single sample facets gene level output | ||
pattern: "*.{txt}" | ||
|
||
## TODO nf-core: Add a description of all of the variables used as output | ||
output: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
## TODO nf-core: Delete / customise this example output | ||
- bam: | ||
type: file | ||
description: Sorted BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
|
||
authors: | ||
- "@pintoa1-mskcc" | ||
maintainers: | ||
- "@pintoa1-mskcc" |
This file contains 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,37 @@ | ||
nextflow_process { | ||
|
||
name "Test Process PHYLOWGSPARSECNVS" | ||
script "../main.nf" | ||
process "PHYLOWGSPARSECNVS" | ||
config "./nextflow.config" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "modules_msk" | ||
tag "phylowgsparsecnvs" | ||
|
||
test("phylowgsparsecnvs - txt") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data_mskcc['neoantigen']['facets_gene_level_txt'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
|
||
) | ||
} | ||
|
||
} | ||
|
||
|
||
} |
This file contains 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,37 @@ | ||
{ | ||
"phylowgsparsecnvs - txt": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"cnvs.txt:md5,a2073057a3fe3ffa83ae3c6a6f00d4ab" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,59b3e223572b67b72eb21c625003973d" | ||
], | ||
"cnv": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"cnvs.txt:md5,a2073057a3fe3ffa83ae3c6a6f00d4ab" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,59b3e223572b67b72eb21c625003973d" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-03-06T14:35:27.270866" | ||
} | ||
} |
This file contains 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 @@ | ||
params { | ||
enable_conda = false | ||
} | ||
|
||
process { | ||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
withName: 'PHYLOWGSPARSECNVS' { | ||
ext.args = '-c 0 -f facets' | ||
} | ||
} |
This file contains 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,2 @@ | ||
phylowgsparsecnvs: | ||
- "modules/msk/phylowgsparsecnvs/**" |
This file contains 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