From ddf4ff3e61e231dd0d360ceb89e11b7970d4e55e Mon Sep 17 00:00:00 2001 From: nichole Date: Thu, 15 Aug 2024 09:53:34 -0700 Subject: [PATCH 1/3] add --beagle-dosages flag --- gwas/aou/aou_gwas.py | 3 ++- gwas/aou/associatr_runner.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gwas/aou/aou_gwas.py b/gwas/aou/aou_gwas.py index 400a865d..8b4474b4 100755 --- a/gwas/aou/aou_gwas.py +++ b/gwas/aou/aou_gwas.py @@ -110,6 +110,7 @@ def main(): parser.add_argument("--MAF", help="Apply minor allele frequency QC", type=float, default=0.01) parser.add_argument("--HWE", help="Apply HWE p-value cutoff QC", type=float, default=1e-100) parser.add_argument("--GQ", help="Apply minimun genotype score QC", type=int, default=20) + parser.add_argument("--beagle-dosages", help="Apply beagle dosages flag to associaTR ,Default: False",action="store_true") args = parser.parse_args() # Set up paths @@ -185,7 +186,7 @@ def main(): runner = HailRunner(data, region=args.region, covars=covars, sample_call_rate=args.sample_call_rate, variant_call_rate=args.variant_call_rate, MAF=args.MAF, HWE=args.HWE, GQ=args.GQ) elif args.method == "associaTR": from associatr_runner import AssociaTRRunner - runner = AssociaTRRunner(data, args.tr_vcf, region=args.region, covars=covars) + runner = AssociaTRRunner(data, args.tr_vcf, region=args.region, covars=covars, beagle=args.beagle_dosages) else: ERROR("GWAS method %s not implemented" % args.method) diff --git a/gwas/aou/associatr_runner.py b/gwas/aou/associatr_runner.py index a4524222..93f6fa0d 100644 --- a/gwas/aou/associatr_runner.py +++ b/gwas/aou/associatr_runner.py @@ -9,13 +9,14 @@ import trtools.associaTR class AssociaTRRunner: - def __init__(self, ptcovar, trvcf, region=None, covars=[]): + def __init__(self, ptcovar, trvcf, beagle, region=None, covars=[]): self.ptcovar = ptcovar self.pt_npy = None self.covar_npy = None self.trvcf = trvcf self.region = region self.covars = covars + self.beagle = beagle self.gwas = None self.method = "associaTR" self.setup() @@ -42,7 +43,7 @@ def RunGWAS(self): same_samples = False sample_list = None non_major_cutoff = 20 - beagle_dosages = False + #beagle_dosages = False plotting_phenotype = None paired_genotype_plot = False plot_genotype_residuals = False @@ -59,7 +60,7 @@ def RunGWAS(self): sample_list, self.region, non_major_cutoff, - beagle_dosages, + self.beagle, plotting_phenotype, paired_genotype_plot, plot_genotype_residuals, From 0bdf58f93148c8366c6f80c85db9aed6a51d888e Mon Sep 17 00:00:00 2001 From: nichole Date: Thu, 15 Aug 2024 09:58:04 -0700 Subject: [PATCH 2/3] add --beagle-dosages in readme --- gwas/aou/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/gwas/aou/README.md b/gwas/aou/README.md index 0e339f52..f790f761 100644 --- a/gwas/aou/README.md +++ b/gwas/aou/README.md @@ -54,6 +54,7 @@ Optional arguments: * `--MAF`: Apply minor allele frequency QC. Default=0.01 * `--HWE`: Apply HWE p-value cutoff QC. Default=1e-15 * `--GQ`: Apply minimun genotype score QC. Default=20 +* `--beagle-dosages`: AApply beagle dosages flag to associaTR. Default=false ## Important file locations: From fd968b647303c618fccf261c365915ebfc8b8f8a Mon Sep 17 00:00:00 2001 From: nichole Date: Thu, 15 Aug 2024 09:58:48 -0700 Subject: [PATCH 3/3] add --beagle-dosages in readme --- gwas/aou/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwas/aou/README.md b/gwas/aou/README.md index f790f761..78a2997e 100644 --- a/gwas/aou/README.md +++ b/gwas/aou/README.md @@ -54,7 +54,7 @@ Optional arguments: * `--MAF`: Apply minor allele frequency QC. Default=0.01 * `--HWE`: Apply HWE p-value cutoff QC. Default=1e-15 * `--GQ`: Apply minimun genotype score QC. Default=20 -* `--beagle-dosages`: AApply beagle dosages flag to associaTR. Default=false +* `--beagle-dosages`: Apply beagle dosages flag to associaTR. Default=false ## Important file locations: