Commit 730b5011 authored by hjulienn's avatar hjulienn
Browse files

add command line argument minimum ld

parent af3d8532
......@@ -17,7 +17,8 @@ def launch_chromosome_imputation(args):
save_chromosome_imputation(args.gwas, args.chrom, args.window_size,
args.buffer_size, args.l2_regularization, args.eigen_threshold,
args.zscore_folder, args.ref_folder, args.ld_folder, args.output_folder,
args.R2_threshold, ref_panel_suffix=args.ref_panel_suffix, ld_type=args.ld_type)
args.R2_threshold, ref_panel_suffix=args.ref_panel_suffix,
ld_type=args.ld_type, minimum_ld=args.minimum_ld)
def add_chromosome_imputation_argument():
......@@ -38,6 +39,7 @@ def add_chromosome_imputation_argument():
parser.add_argument('--R2-threshold', help= "R square (imputation quality) threshold bellow which SNPs are filtered from the output", default = 0.6)
parser.add_argument("--ld-type", help= "Ld can be supplied as plink command --ld-snp-list output files (see raiss.ld_matrix.launch_plink_ld to compute these data using plink) or as a couple of a scipy sparse matrix (.npz )and an .csv containing SNPs index", default="plink")
parser.add_argument('--ref-panel-suffix', help= "end of the suffix for the reference panel files", default = ".bim")
parser.add_argument('--minimum-ld', help = "this parameter ensure that their is enough typed SNPs around the imputed to perform a high accuracy imputation", default = "20")
......@@ -10,7 +10,7 @@ from raiss.imputation_launcher import ImputationLauncher
def save_chromosome_imputation(gwas, chrom, window_size, buffer_size,
l2_regularization, eigen_threshold, zscore_folder,
ref_folder, ld_folder, output_folder, R2_threshold,
tag="", ref_panel_suffix=".eur.1pct.bim", ld_type="plink"):
tag="", ref_panel_suffix=".eur.1pct.bim", ld_type="plink", minimum_ld=20):
module to manage the creation of files to save the results of imputation
......@@ -43,5 +43,5 @@ def save_chromosome_imputation(gwas, chrom, window_size, buffer_size,
# and Saving results
minimum_ld = 20
z_fo = "{0}/z_{1}_{2}{3}.txt".format(output_folder, gwas, chrom, tag)
filter_output(imputed_zscore, z_fo, float(R2_threshold))
filter_output(imputed_zscore, z_fo, float(R2_threshold), minimum_ld=minimum_ld)
print("Save imputation done at {0}".format(z_fo))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment