aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorAlexanderlacuna2020-11-09 13:20:53 +0300
committerAlexanderlacuna2020-11-09 13:20:53 +0300
commit7aaa4b87fcf405c32c11e2e2d664941c43c14430 (patch)
tree198a93a3bf5cb68f67e11cc74247c8743eb0842e /wqflask
parent5e50e19a014efdfcf0ce1397025879d4ada4d271 (diff)
downloadgenenetwork2-7aaa4b87fcf405c32c11e2e2d664941c43c14430.tar.gz
refactor marker_regression/gemma-mapping.py run-gemma function to avoid Index Error
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/marker_regression/gemma_mapping.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index 68a8d5ba..02f91a32 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -31,16 +31,11 @@ def run_gemma(this_trait, this_dataset, samples, vals, covariates, use_loco, maf
gwa_output_filename = this_dataset.group.name + "_GWA_" + ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(6))
this_chromosomes = this_dataset.species.chromosomes.chromosomes
- chr_list_string = ""
- for i in range(len(this_chromosomes)):
- if i < (len(this_chromosomes) - 1):
- chr_list_string += this_chromosomes[i+1].name + ","
- else:
- chr_list_string += this_chromosomes[i+1].name
+ this_chromosomes_name=[chromosome.name for chromosome in this_chromosomes]
+ chr_list_string=",".join(this_chromosomes_name)
if covariates != "":
gen_covariates_file(this_dataset, covariates, samples)
-
if use_loco == "True":
generate_k_command = GEMMA_WRAPPER_COMMAND + ' --json --loco ' + chr_list_string + ' -- ' + GEMMAOPTS + ' -g %s/%s_geno.txt -p %s/gn2/%s.txt -a %s/%s_snps.txt -gk > %s/gn2/%s.json' % (flat_files('genotype/bimbam'),
genofile_name,