Skip to content
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

Integration of VCF and BGEN for gene-based testing #92

Merged
merged 15 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ class WorkflowMain {
exit 1, "Invalid config file. The 'write-mask' option does not work when building masks with 'sum'."
}

if(params.genotypes_association_chunk_size > 0 ) {
//&& genotypes_association_format != 'bgen' ) {
exit 1, " Chunking is currently not available for gene-based tests (param: genotypes_association_chunk_size=0)."
}

//Check association file format for gene-based tests
if (genotypes_association_format != 'bed'){
exit 1, "File format " + genotypes_association_format + " currently not supported for gene-based tests. Please use 'bed' input instead. "
if (genotypes_association_format != 'vcf' && genotypes_association_format != "bgen"){
exit 1, "File format " + genotypes_association_format + " currently not supported for gene-based tests. Please use 'vcf' or 'bgen' input instead. "
}
} else {
//Check if tests exists
Expand Down
7 changes: 5 additions & 2 deletions modules/local/regenie/regenie_step2_run_gene_tests.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ process REGENIE_STEP2_RUN_GENE_TESTS {

input:
path step1_out
tuple val(filename), path(genotyped_plink_file)
tuple val(filename), path(genotyped_plink_bim_file), path(genotyped_plink_bed_file), path(genotyped_plink_fam_file), val(range)
val assoc_format
path phenotypes_file
path covariates_file
path sample_file
path regenie_gene_anno_file
path regenie_gene_setlist_file
path regenie_gene_masks_file
Expand All @@ -20,8 +21,9 @@ process REGENIE_STEP2_RUN_GENE_TESTS {
path "${filename}_masks*"

script:
def format = assoc_format == 'bed' ? "--bed" : '--bgen'
def format = assoc_format == 'bgen' ? "--bgen" : '--pgen'
def extension = assoc_format == 'bgen' ? ".bgen" : ''
def bgen_sample = sample_file ? "--sample $sample_file" : ''
def firthApprox = params.regenie_firth_approx ? "--approx" : ""
def firth = params.regenie_firth ? "--firth $firthApprox" : ""
def binaryTrait = params.phenotypes_binary_trait ? "--bt $firth " : ""
Expand Down Expand Up @@ -65,6 +67,7 @@ process REGENIE_STEP2_RUN_GENE_TESTS {
$predictions \
$apply_rint \
$geneTest \
$bgen_sample \
$aaf \
$maxAaf \
$vcMACThr \
Expand Down
Loading
Loading