Skip to content

Commit

Permalink
Merge pull request #5 from genepi/fixes/lift-over
Browse files Browse the repository at this point in the history
Fixes/lift over
  • Loading branch information
seppinho authored Jun 18, 2024
2 parents af2496c + 7de19be commit 680bda3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
10 changes: 8 additions & 2 deletions files/rsq-report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ params:
library(ggplot2)
library(dplyr)
library(knitr)
```

## Parameters
Expand All @@ -29,7 +30,7 @@ library(dplyr)
| Job | `r params$name` |
| Date | `r params$date` |

## RSQ Plot
## RSQ Table
```{r echo=FALSE}
dataset = read.csv(params$input, row.names=NULL, sep = '\t')
dataset_weighted = dataset %>%
Expand All @@ -42,8 +43,13 @@ dataset_weighted = dataset %>%
weighted_R2 = weighted.mean(Imputation.R2,X.Variants)
)
ggplot() + geom_line(data = dataset_weighted, mapping = aes(x = mean_MAF, y= weighted_R2)) + scale_x_log10() + expand_limits(x = 0, y = 0)
kable(dataset_weighted)
```

## RSQ Plot

```{r echo=FALSE}
ggplot() + geom_line(data = dataset_weighted, mapping = aes(x = mean_MAF, y= weighted_R2)) + scale_x_log10() + expand_limits(x = 0, y = 0)
```

<small>
Expand Down
4 changes: 2 additions & 2 deletions modules/local/lift_over.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ process LIFT_OVER {
//publishDir "${params.outdir}/aggRSquare", mode: 'copy', pattern: '*aggRSquare'

input:
tuple val(chr), val(array_name), path(dosage_data), path(sequence_data)
tuple val(chr), path(dosage_data), path(sequence_data)

output:
tuple val(chr), val(array_name), path(dosage_data), path("${sequence_data.baseName}.liftover.vcf.gz"), emit: sequence_data_lifted
tuple val(chr), path(dosage_data), path("${sequence_data.baseName}.liftover.vcf.gz"), emit: sequence_data_lifted

script:
def chain_file = (params.sequence_build == 'hg19' ? "/opt/imputationserver/chains/hg19ToHg38.over.chain.gz" : '/opt/imputationserver/chains/hg38ToHg19.over.chain.gz')
Expand Down
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ profiles {

development {
docker.enabled = true
docker.userEmulation = true
singularity.enabled = false
}

Expand Down
19 changes: 19 additions & 0 deletions tests/microarray.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,23 @@ nextflow_pipeline {

}

test("Rsq calculation for hg19/hg38") {

when {
params {
project = "r2_calculation_hg19"
workflow_name = "r2"
imputation_build = "hg19"
sequence_build = "hg38"
imputed_data = "$projectDir/tests/data/imputed_data/hg19/*vcf.gz"
sequence_data = "$projectDir/tests/data/sequence_data/hg38/*vcf.gz"
}
}

then {
assert workflow.success
}

}

}

0 comments on commit 680bda3

Please sign in to comment.