aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-27 01:18:11 +0300
committerBonfaceKilz2020-08-27 01:42:41 +0300
commit357ca458695fbc60c97de3d1cdf89034a8722bc5 (patch)
tree54179a761cb25a871370d7a815eed97d5e0497df /scripts
parent768de71f09b116cad0f42c792c22a7dc410ea2f4 (diff)
downloadgenenetwork2-357ca458695fbc60c97de3d1cdf89034a8722bc5.tar.gz
Replace "string.split" & "string.join" with python's inbuilt methods
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maintenance/readProbeSetMean_v7.py20
-rwxr-xr-xscripts/maintenance/readProbeSetSE_v7.py14
2 files changed, 17 insertions, 17 deletions
diff --git a/scripts/maintenance/readProbeSetMean_v7.py b/scripts/maintenance/readProbeSetMean_v7.py
index a540796a..43f084f4 100755
--- a/scripts/maintenance/readProbeSetMean_v7.py
+++ b/scripts/maintenance/readProbeSetMean_v7.py
@@ -60,15 +60,15 @@ print('Checking if each line have same number of members')
GeneList = []
isCont = 1
header = fp.readline()
-header = string.split(string.strip(header), '\t')
-header = list(map(string.strip, header))
+header = header.strip().split('\t')
+header = [x.strip() for x in header]
nfield = len(header)
line = fp.readline()
kj = 0
while line:
- line2 = string.split(string.strip(line), '\t')
- line2 = list(map(string.strip, line2))
+ line2 = line.strip().split('\t')
+ line2 = [x.strip() for x in line2]
if len(line2) != nfield:
print(("Error : " + line))
isCont = 0
@@ -98,8 +98,8 @@ print('Checking if each strain exist in database')
isCont = 1
fp.seek(0)
header = fp.readline()
-header = string.split(string.strip(header), '\t')
-header = list(map(string.strip, header))
+header = header.strip().split('\t')
+header = [x.strip() for x in header]
header = list(map(translateAlias, header))
header = header[dataStart:]
Ids = []
@@ -126,8 +126,8 @@ print('Check if each ProbeSet exist in database')
##---- find PID is name or target ----##
line = fp.readline()
line = fp.readline()
-line2 = string.split(string.strip(line), '\t')
-line2 = list(map(string.strip, line2))
+line2 = line.strip().split('\t')
+line2 = [x.strip() for x in line2]
PId = line2[0]
db.execute('select Id from ProbeSet where Name="%s" and ChipId=%d' %
@@ -222,8 +222,8 @@ kj = 0
values1 = []
values2 = []
while line:
- line2 = string.split(string.strip(line), '\t')
- line2 = list(map(string.strip, line2))
+ line2 = line.strip().split('\t')
+ line2 = [x.strip() for x in line2]
PId = line2[0]
recordId = NameIds[PId]
diff --git a/scripts/maintenance/readProbeSetSE_v7.py b/scripts/maintenance/readProbeSetSE_v7.py
index 20a846a4..edd9e7b0 100755
--- a/scripts/maintenance/readProbeSetSE_v7.py
+++ b/scripts/maintenance/readProbeSetSE_v7.py
@@ -71,14 +71,14 @@ print('Checking if each line have same number of members')
GeneList = []
isCont = 1
header = fp.readline()
-header = string.split(string.strip(header), '\t')
+header = header.strip().split('\t')
header = list(map(string.strip, header))
nfield = len(header)
line = fp.readline()
kj = 0
while line:
- line2 = string.split(string.strip(line), '\t')
+ line2 = line.strip().split('\t')
line2 = list(map(string.strip, line2))
if len(line2) != nfield:
isCont = 0
@@ -109,7 +109,7 @@ print('Checking if each strain exist in database')
isCont = 1
fp.seek(0)
header = fp.readline()
-header = string.split(string.strip(header), '\t')
+header = header.strip().split('\t')
header = list(map(string.strip, header))
header = list(map(translateAlias, header))
header = header[dataStart:]
@@ -137,8 +137,8 @@ print('Check if each ProbeSet exist in database')
##---- find PID is name or target ----##
line = fp.readline()
line = fp.readline()
-line2 = string.split(string.strip(line), '\t')
-line2 = list(map(string.strip, line2))
+line2 = line.strip().split('\t')
+line2 = [x.strip() for x in line2]
PId = line2[0]
db.execute('select Id from ProbeSet where Name="%s" and ChipId=%d' %
@@ -217,8 +217,8 @@ line = fp.readline()
kj = 0
while line:
- line2 = string.split(string.strip(line), '\t')
- line2 = list(map(string.strip, line2))
+ line2 = line.strip().split('\t')
+ line2 = [x.strip() for x in line2]
CellId = line2[0]
if CellId not in ProbeNameId: