From 120968f45288905b10dba990ed438e30ddc61695 Mon Sep 17 00:00:00 2001 From: Eva Holtkamp Date: Thu, 12 Oct 2023 16:51:16 +0200 Subject: [PATCH] require MAF column argument --- deeprvat/seed_gene_discovery/seed_gene_discovery.py | 9 ++------- pipelines/seed_gene_discovery.snakefile | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/deeprvat/seed_gene_discovery/seed_gene_discovery.py b/deeprvat/seed_gene_discovery/seed_gene_discovery.py index c0518310..933c3577 100644 --- a/deeprvat/seed_gene_discovery/seed_gene_discovery.py +++ b/deeprvat/seed_gene_discovery/seed_gene_discovery.py @@ -469,7 +469,7 @@ def update_config( simulated_phenotype_file: str, variant_type: Optional[str], rare_maf: Optional[float], - maf_column: Optional[str], + maf_column: str, new_config_file: str, ): with open(old_config_file) as f: @@ -479,12 +479,7 @@ def update_config( config["data"]["dataset_config"][ "sim_phenotype_file" ] = simulated_phenotype_file - if maf_column is None: - annotations = config["data"]["dataset_config"]["annotations"] - af_pattern = re.compile(r".*(_MAF|_AF|MAF)\b") - rare_maf_col = [s for s in annotations if af_pattern.match(s)] - assert len(rare_maf_col) == 1 - maf_column = rare_maf_col[0] + logger.info(f'Reading MAF column from column {maf_column}') if phenotype is not None: config["data"]["dataset_config"]["y_phenotypes"] = [phenotype] diff --git a/pipelines/seed_gene_discovery.snakefile b/pipelines/seed_gene_discovery.snakefile index 0aa03d97..7a93ac26 100644 --- a/pipelines/seed_gene_discovery.snakefile +++ b/pipelines/seed_gene_discovery.snakefile @@ -261,6 +261,7 @@ rule config: "seed_gene_pipeline update-config " + "--phenotype {wildcards.phenotype} " + "--variant-type {wildcards.vtype} " + + "--maf-column MAF " + "--rare-maf " + "{params.rare_maf}" + " {input.config} "