Skip to content

Commit 6286ffd

Browse files
committed
Add rsq calculation as a workflow
1 parent 191e05f commit 6286ffd

32 files changed

+136
-108
lines changed

.github/workflows/ci-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Install nf-test
2727
run: |
28-
wget -qO- get.nf-test.com | bash -s 0.9.0-rc2
28+
wget -qO- get.nf-test.com | bash -s 0.9.0-rc2
2929
sudo mv nf-test /usr/local/bin/
3030
3131
- name: Set up Docker Buildx

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ nextflow run main.nf -profile test --imputation_token <token>
1111
```
1212

1313
## Run Chip Simulation
14+
This command simulates array data from sequencing data. For each strand file included, an array will be created.
1415
```
15-
nextflow run workflows/chip_simulation.nf -c tests/mtdna.config -profile development
16+
nextflow run main.nf -c tests/simulate_hg19.config -profile development
17+
```
18+
19+
## Run RSQ Calculation
20+
This command calculates the RSQ between sequencing data and imputed data.
21+
```
22+
nextflow run main.nf -c tests/r2_calcuation.config -profile development
1623
```
1724

1825
## Run Tests

conf/mtdna.config

-23
This file was deleted.

main.nf

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
1-
#!/usr/bin/env nextflow
21
/*
32
========================================================================================
4-
seppinho/microarray-eval-nf
3+
genepi/microarray-eval-nf
54
========================================================================================
6-
Github : https://github.com/seppinho/microarray-eval-nf
5+
Github : https://github.com/genepi/microarray-eval-nf
76
Author: Sebastian Schönherr, Lukas Forer, Martin Eberle
87
---------------------------
98
*/
109

1110
nextflow.enable.dsl = 2
1211

13-
switch (params.workflow_name) {
14-
case 'simulate':
15-
include { ARRAY_SIMULATION } from './workflows/chip_simulation'
16-
workflow {
17-
ARRAY_SIMULATION ()
18-
}
19-
break
20-
default:
21-
error "Unknown workflow: ${params.workflow_name}"
22-
break
12+
if(params.outdir == null) {
13+
params.pubDir = "output/${params.project}"
14+
} else {
15+
params.pubDir = params.outdir
16+
}
17+
18+
include { SIMULATION } from './workflows/simulation'
19+
include { RSQ } from './workflows/rsq'
20+
21+
workflow {
22+
23+
switch (params.workflow_name) {
24+
25+
case 'simulate':
26+
SIMULATION ()
27+
break
28+
29+
case 'r2':
30+
RSQ ()
31+
break
32+
33+
default:
34+
error "Unknown workflow: ${params.workflow_name}"
35+
break
36+
37+
}
38+
2339
}

modules/local/calculate_imputation_accuracy.nf

-25
This file was deleted.

modules/local/calculate_rsq.nf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
process CALCULATE_RSQ {
2+
3+
publishDir "${params.pubDir}/aggRSquare", mode: 'copy', pattern: '*aggRSquare'
4+
5+
input:
6+
tuple val(chr), path(dosage_data), path(sequence_data)
7+
8+
output:
9+
path("*aggRSquare"), emit: agg_rsquare
10+
11+
12+
"""
13+
aggRSquare -v ${sequence_data} -i ${dosage_data} -o ${sequence_data.baseName} --d
14+
"""
15+
}

modules/local/prepare_rsq_browser_data.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process PREPARE_RSQ_BROWSER_DATA {
22

3-
publishDir "${params.outdir}/${array_name}", mode: 'copy'
3+
publishDir "${params.pubDir}/${array_name}", mode: 'copy'
44

55
input:
66
tuple val(array_name), path(array)

modules/local/simulate_array.nf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
process SIMULATE_ARRAY {
22

3+
publishDir "${params.pubDir}/simulation", mode: 'copy', pattern: '*vcf.gz'
4+
35
input:
46
tuple val(chr), path(strand_data), path(sequence_data)
57
path sample_file

tests/calc_rsq_hg19.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
params {
2+
project = "calc_rsq_hg19"
3+
workflow_name = "r2"
4+
imputed_data = "$projectDir/tests/data/imputed_data/hg19/*vcf.gz"
5+
sequence_data = "$projectDir/tests/data/sequence_data/hg19/*vcf.gz"
6+
}

0 commit comments

Comments
 (0)