aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-19 02:41:46 +0300
committerBonfaceKilz2020-08-19 02:41:46 +0300
commite55b1502340cc99cd8a5d705261a5ff3c87f3718 (patch)
tree8b38bf14565a74a58159553fbe947460f7ee218a
parent28e75b1c96819eab1e8052a3045ece26e5f35c42 (diff)
downloadgenenetwork2-e55b1502340cc99cd8a5d705261a5ff3c87f3718.tar.gz
Change `dict.has_key(key)` to `key in dict`
Run `2to3-3.8 -f has_key -w .` See: <https://docs.python.org/2/library/2to3.html#2to3fixer-has_key>
-rwxr-xr-xscripts/maintenance/readProbeSetSE_v7.py2
-rw-r--r--wqflask/wqflask/marker_regression/plink_mapping.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/scripts/maintenance/readProbeSetSE_v7.py b/scripts/maintenance/readProbeSetSE_v7.py
index 7b2fee87..2700a8ef 100755
--- a/scripts/maintenance/readProbeSetSE_v7.py
+++ b/scripts/maintenance/readProbeSetSE_v7.py
@@ -223,7 +223,7 @@ while line:
line2 = list(map(string.strip, line2))
CellId = line2[0]
- if not ProbeNameId.has_key(CellId):
+ if CellId not in ProbeNameId:
ferror.write(CellId + " doesn't exist\n")
else:
DataId = ProbeNameId[CellId]
diff --git a/wqflask/wqflask/marker_regression/plink_mapping.py b/wqflask/wqflask/marker_regression/plink_mapping.py
index 9571015e..38ef7190 100644
--- a/wqflask/wqflask/marker_regression/plink_mapping.py
+++ b/wqflask/wqflask/marker_regression/plink_mapping.py
@@ -111,7 +111,7 @@ def parse_plink_output(output_filename, species):
line_list = build_line_list(line=line)
# only keep the records whose chromosome name is in db
- if species.chromosomes.chromosomes.has_key(int(line_list[0])) and line_list[-1] and line_list[-1].strip()!='NA':
+ if int(line_list[0]) in species.chromosomes.chromosomes and line_list[-1] and line_list[-1].strip()!='NA':
chr_name = species.chromosomes.chromosomes[int(line_list[0])]
snp = line_list[1]
@@ -121,7 +121,7 @@ def parse_plink_output(output_filename, species):
if p_value < threshold_p_value:
p_value_dict[snp] = float(p_value)
- if plink_results.has_key(chr_name):
+ if chr_name in plink_results:
value_list = plink_results[chr_name]
# pvalue range is [0,1]