diff --git a/LDlink/LDassoc.py b/LDlink/LDassoc.py index 30e7dd20..b861cf9d 100755 --- a/LDlink/LDassoc.py +++ b/LDlink/LDassoc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import csv import json @@ -552,13 +552,13 @@ def get_coords_gene(gene_raw): print("Create LDassoc_sub subprocesses") for i in range(threads): if i==min(range(threads)) and i==max(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords)+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords)+" "+request+" "+str(i) elif i==min(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[:block])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[:block])+" "+request+" "+str(i) elif i==max(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:])+" "+request+" "+str(i) else: - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:block*(i+1)])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:block*(i+1)])+" "+request+" "+str(i) commands.append(command) @@ -1122,7 +1122,7 @@ def get_output(process): if web: # Open thread for high quality image exports print("Open thread for high quality image exports.") - command = "python LDassoc_plot_sub.py " + tmp_dir + 'assoc_args' + request + ".json" + " " + file + " " + region + " " + pop + " " + request + " " + myargsName + " " + myargsOrigin + command = "python3 LDassoc_plot_sub.py " + tmp_dir + 'assoc_args' + request + ".json" + " " + file + " " + region + " " + pop + " " + request + " " + myargsName + " " + myargsOrigin subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) @@ -1264,7 +1264,7 @@ def get_output(process): if web: # Open thread for high quality image exports print("Open thread for high quality image exports.") - command = "python LDassoc_plot_sub.py " + tmp_dir + 'assoc_args' + request + ".json" + " " + file + " " + region + " " + pop + " " + request + " " + myargsName + " " + myargsOrigin + command = "python3 LDassoc_plot_sub.py " + tmp_dir + 'assoc_args' + request + ".json" + " " + file + " " + region + " " + pop + " " + request + " " + myargsName + " " + myargsOrigin subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ########################### diff --git a/LDlink/LDassoc_plot_sub.py b/LDlink/LDassoc_plot_sub.py index bdae4834..32029112 100644 --- a/LDlink/LDassoc_plot_sub.py +++ b/LDlink/LDassoc_plot_sub.py @@ -386,17 +386,17 @@ def get_coords_gene(gene_raw): else: threads=4 - block=len(assoc_coords)/threads + block=len(assoc_coords)//threads commands=[] for i in range(threads): if i==min(range(threads)) and i==max(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords)+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords)+" "+request+" "+str(i) elif i==min(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[:block])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[:block])+" "+request+" "+str(i) elif i==max(range(threads)): - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:])+" "+request+" "+str(i) else: - command="python LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:block*(i+1)])+" "+request+" "+str(i) + command="python3 LDassoc_sub.py "+snp+" "+chromosome+" "+"_".join(assoc_coords[(block*i)+1:block*(i+1)])+" "+request+" "+str(i) commands.append(command) diff --git a/LDlink/LDhap.py b/LDlink/LDhap.py index a278d389..7e3b274b 100755 --- a/LDlink/LDhap.py +++ b/LDlink/LDhap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import json import math diff --git a/LDlink/LDmatrix.py b/LDlink/LDmatrix.py index ead9ae30..14a55ca2 100755 --- a/LDlink/LDmatrix.py +++ b/LDlink/LDmatrix.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import json import math @@ -907,7 +907,7 @@ def set_alleles(a1, a2): # Generate high quality images only if accessed via web instance if web: # Open thread for high quality image exports - command = "python LDmatrix_plot_sub.py " + \ + command = "python3 LDmatrix_plot_sub.py " + \ snplst + " " + pop + " " + request + " " + r2_d subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) diff --git a/LDlink/LDpair.py b/LDlink/LDpair.py index 3cd0326c..03f0de51 100755 --- a/LDlink/LDpair.py +++ b/LDlink/LDpair.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import json import math diff --git a/LDlink/LDpop.py b/LDlink/LDpop.py index 97586828..1703a209 100755 --- a/LDlink/LDpop.py +++ b/LDlink/LDpop.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import json import math diff --git a/LDlink/LDproxy.py b/LDlink/LDproxy.py index 5f8c5cc4..9e71565c 100755 --- a/LDlink/LDproxy.py +++ b/LDlink/LDproxy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import csv import json @@ -249,18 +249,18 @@ def replace_coord_rsid(snp): commands = [] for i in range(threads): if i == min(range(threads)) and i == max(range(threads)): - command = "python LDproxy_sub.py " + str(web) + " " + snp + " " + \ + command = "python3 LDproxy_sub.py " + str(web) + " " + snp + " " + \ snp_coord['chromosome'] + " " + str(coord1) + " " + \ str(coord2) + " " + request + " " + str(i) elif i == min(range(threads)): - command = "python LDproxy_sub.py " + str(web) + " " + snp + " " + \ + command = "python3 LDproxy_sub.py " + str(web) + " " + snp + " " + \ snp_coord['chromosome'] + " " + str(coord1) + " " + \ str(coord1 + block) + " " + request + " " + str(i) elif i == max(range(threads)): - command = "python LDproxy_sub.py " + str(web) + " " + snp + " " + snp_coord['chromosome'] + " " + str( + command = "python3 LDproxy_sub.py " + str(web) + " " + snp + " " + snp_coord['chromosome'] + " " + str( coord1 + (block * i) + 1) + " " + str(coord2) + " " + request + " " + str(i) else: - command = "python LDproxy_sub.py " + str(web) + " " + snp + " " + snp_coord['chromosome'] + " " + str(coord1 + ( + command = "python3 LDproxy_sub.py " + str(web) + " " + snp + " " + snp_coord['chromosome'] + " " + str(coord1 + ( block * i) + 1) + " " + str(coord1 + (block * (i + 1))) + " " + request + " " + str(i) commands.append(command) @@ -818,7 +818,7 @@ def get_output(process): # Generate high quality images only if accessed via web instance if web: # Open thread for high quality image exports - command = "python LDproxy_plot_sub.py " + snp + " " + pop + " " + request + " " + r2_d + command = "python3 LDproxy_plot_sub.py " + snp + " " + pop + " " + request + " " + r2_d subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ########################### diff --git a/LDlink/LDproxy_plot_sub.py b/LDlink/LDproxy_plot_sub.py index c8b521aa..bf7264ae 100644 --- a/LDlink/LDproxy_plot_sub.py +++ b/LDlink/LDproxy_plot_sub.py @@ -179,18 +179,18 @@ def replace_coord_rsid(db, snp): commands = [] for i in range(threads): if i == min(range(threads)) and i == max(range(threads)): - command = "python LDproxy_sub.py " + "True " + snp + " " + \ + command = "python3 LDproxy_sub.py " + "True " + snp + " " + \ snp_coord['chromosome'] + " " + str(coord1) + " " + \ str(coord2) + " " + request + " " + str(i) elif i == min(range(threads)): - command = "python LDproxy_sub.py " + "True " + snp + " " + \ + command = "python3 LDproxy_sub.py " + "True " + snp + " " + \ snp_coord['chromosome'] + " " + str(coord1) + " " + \ str(coord1 + block) + " " + request + " " + str(i) elif i == max(range(threads)): - command = "python LDproxy_sub.py " + "True " + snp + " " + snp_coord['chromosome'] + " " + str( + command = "python3 LDproxy_sub.py " + "True " + snp + " " + snp_coord['chromosome'] + " " + str( coord1 + (block * i) + 1) + " " + str(coord2) + " " + request + " " + str(i) else: - command = "python LDproxy_sub.py " + "True " + snp + " " + snp_coord['chromosome'] + " " + str(coord1 + ( + command = "python3 LDproxy_sub.py " + "True " + snp + " " + snp_coord['chromosome'] + " " + str(coord1 + ( block * i) + 1) + " " + str(coord1 + (block * (i + 1))) + " " + request + " " + str(i) commands.append(command) diff --git a/LDlink/RegisterAPI.py b/LDlink/RegisterAPI.py index 12b3d764..66f06e6a 100644 --- a/LDlink/RegisterAPI.py +++ b/LDlink/RegisterAPI.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import json import os.path import binascii diff --git a/LDlink/SNPchip.py b/LDlink/SNPchip.py index dbb1a449..6e7c01bc 100755 --- a/LDlink/SNPchip.py +++ b/LDlink/SNPchip.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ########### # SNPchip # diff --git a/LDlink/SNPclip.py b/LDlink/SNPclip.py index e901a59a..61e58f55 100755 --- a/LDlink/SNPclip.py +++ b/LDlink/SNPclip.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import yaml import json import math diff --git a/LDlink/UnlockStaleTokens.py b/LDlink/UnlockStaleTokens.py index a0e5bedc..7f4b4f3c 100644 --- a/LDlink/UnlockStaleTokens.py +++ b/LDlink/UnlockStaleTokens.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import datetime import dateutil.parser import yaml