Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit 1885417

Browse files
authored
Merge pull request icgc-argo-workflows#28 from ICGC-ARGO-Structural-Variation-CN-WG/facets-wf@0.2.0
Facets wf@0.2.0 [release]
2 parents 110864d + b8c652e commit 1885417

56 files changed

Lines changed: 2474 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

facets-wf/main.nf

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env nextflow
2+
3+
/*
4+
Copyright (c) 2021, ICGC-ARGO-Structural-Variation-CN-WG
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
Authors:
25+
Andrej Benjak
26+
*/
27+
28+
nextflow.enable.dsl = 2
29+
version = '0.2.0'
30+
31+
// universal params go here, change default value as needed
32+
params.container = ""
33+
params.container_registry = ""
34+
params.container_version = ""
35+
params.cpus = 1
36+
params.mem = 1 // GB
37+
params.publish_dir = "" // set to empty string will disable publishDir
38+
39+
// tool specific parmas go here, add / change as needed
40+
params.tumor = ""
41+
params.normal = ""
42+
params.dbsnp = "${baseDir}/resources/dbsnp_151.common.hg38.vcf.gz"
43+
params.ref = ""
44+
params.cleanup = true
45+
46+
include { getSecondaryFiles; snpPileup } from './wfpr_modules/github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number/snp-pileup@0.3.1/main.nf' params([*:params, 'cleanup': false])
47+
include { facets } from './wfpr_modules/github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number/facets@0.4.1/main.nf' params([*:params, 'cleanup': false])
48+
49+
// please update workflow code as needed
50+
workflow FacetsWf {
51+
52+
take:
53+
tumor
54+
normal
55+
dbsnp
56+
ref
57+
ref_idx
58+
59+
60+
main:
61+
snpPileup(
62+
tumor,
63+
normal,
64+
dbsnp,
65+
ref,
66+
ref_idx
67+
)
68+
69+
facets(
70+
snpPileup.out.output_file
71+
)
72+
73+
74+
emit:
75+
results = facets.out.facets_results
76+
77+
}
78+
79+
80+
// this provides an entry point for this main script, so it can be run directly without clone the repo
81+
// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx
82+
workflow {
83+
FacetsWf(
84+
file(params.tumor),
85+
file(params.normal),
86+
file(params.dbsnp),
87+
file(params.ref),
88+
Channel.fromPath(getSecondaryFiles(params.ref, ['fai','gzi']), checkIfExists: false).collect(),
89+
)
90+
}

facets-wf/nextflow.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker {
2+
enabled = true
3+
runOptions = '-u \$(id -u):\$(id -g)'
4+
}

facets-wf/pkg.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "facets-wf",
3+
"version": "0.2.0",
4+
"description": "facets workflow",
5+
"main": "main.nf",
6+
"deprecated": false,
7+
"keywords": [
8+
"cna",
9+
"purity",
10+
"ploidy"
11+
],
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number.git"
15+
},
16+
"dependencies": [
17+
"github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number/snp-pileup@0.3.1",
18+
"github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number/facets@0.4.1"
19+
],
20+
"devDependencies": [],
21+
"contributors": [
22+
{
23+
"name": "Andrej Benjak",
24+
"email": "abenjak@gmail.com"
25+
}
26+
],
27+
"license": "MIT",
28+
"bugReport": "https://github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number/issues",
29+
"homepage": "https://github.com/icgc-argo-structural-variation-cn-wg/icgc-argo-sv-copy-number#readme"
30+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
mkdir -p $(dirname $0)/../resources
2+
3+
# No "chr" prefix in contig names
4+
# wget -O $(dirname $0)/../resources/dbsnp_151.common.hg38.vcf.gz https://ftp.ncbi.nih.gov/snp/organisms/human_9606/VCF/00-common_all.vcf.gz
5+
6+
# With "chr" prefix in contig names
7+
wget -O $(dirname $0)/../resources/dbsnp_151.common.hg38.vcf.gz "https://campuscloud.unibe.ch/rest/files/public/links/02dc8054785e096c0179d79a20382c09?passKey=-5889296840140272093&shareId=45112"
8+
9+
echo -e "Checking file integrity.\n"
10+
if [ $(md5sum $(dirname $0)/../resources/dbsnp_151.common.hg38.vcf.gz | cut -f1 -d " ") = "e1050e1014c6726127c4d8d4278e2a6a" ]
11+
then
12+
echo "Checksum OK."
13+
else
14+
rm -f $(dirname $0)/resources/dbsnp_151.common.hg38.vcf.gz
15+
echo "Checksum failed. Try downloading again."
16+
fi

facets-wf/tests/checker.nf

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env nextflow
2+
3+
/*
4+
Copyright (c) 2021, ICGC-ARGO-Structural-Variation-CN-WG
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
Authors:
25+
Andrej Benjak
26+
*/
27+
28+
/*
29+
This is an auto-generated checker workflow to test the generated main template workflow, it's
30+
meant to illustrate how testing works. Please update to suit your own needs.
31+
*/
32+
33+
nextflow.enable.dsl = 2
34+
version = '0.2.0'
35+
36+
// universal params
37+
params.publish_dir = ""
38+
params.container = ""
39+
params.container_registry = ""
40+
params.container_version = ""
41+
42+
// tool specific parmas go here, add / change as needed
43+
params.tumor = ""
44+
params.normal = ""
45+
params.dbsnp = ""
46+
params.ref = ""
47+
params.genome = ""
48+
params.out_prefix = ""
49+
params.expected_output = ""
50+
params.cleanup = false
51+
52+
include { FacetsWf } from '../main'
53+
include { getSecondaryFiles } from '../wfpr_modules/github.com/icgc-argo/data-processing-utility-tools/helper-functions@1.0.1/main.nf'
54+
55+
56+
process file_smart_diff {
57+
input:
58+
path output_file
59+
path expected_file
60+
61+
output:
62+
stdout()
63+
64+
shell:
65+
'''
66+
tar -zxvf !{output_file} test.out
67+
diff $(basename -s .tgz !{output_file}).out !{expected_file} \
68+
&& ( echo "Test PASSED" && exit 0 ) || ( echo "Test FAILED, output file mismatch." && exit 1 )
69+
'''
70+
}
71+
72+
73+
workflow checker {
74+
take:
75+
tumor
76+
normal
77+
dbsnp
78+
ref
79+
ref_idx
80+
expected_output
81+
82+
main:
83+
FacetsWf(
84+
tumor,
85+
normal,
86+
dbsnp,
87+
ref,
88+
ref_idx
89+
)
90+
91+
file_smart_diff(
92+
FacetsWf.out.results,
93+
expected_output
94+
)
95+
}
96+
97+
98+
workflow {
99+
checker(
100+
file(params.tumor),
101+
file(params.normal),
102+
file(params.dbsnp),
103+
file(params.ref),
104+
Channel.fromPath(getSecondaryFiles(params.ref, ['fai','gzi']), checkIfExists: false).collect(),
105+
file(params.expected_output)
106+
)
107+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Version = 0.6.1
2+
# Input = test_T.cram.bc.gz
3+
# tumor = test
4+
# snp.nbhd = 500
5+
# cval = 200
6+
# min.nhet = 25
7+
# genome = hg19
8+
# Purity = NA
9+
# Ploidy = 2
10+
# dipLogR = 0.001613941
11+
# dipt =
12+
# loglik =

facets-wf/tests/input/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This folder contains tiny data files for testing.
28.1 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
17 100000 13 60 61
24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)