Skip to content

Commit bc3fd48

Browse files
author
Alexis Morrissey
committed
removing 5bp win
1 parent 515b62d commit bc3fd48

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Allo/allocation.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def addToDict(tempFile, genLand, spliceD, seq):
3232
if seq == 0 and not (count % 2) == 0:
3333
continue
3434
#Getting closest 5bp window
35-
l[3] = round(int(l[3])/5)*5
35+
l[3] = int(l[3]))
3636
#Add to dictionary
3737
key = l[2] + ";" + str(l[3])
3838
if key in genLand:
@@ -51,16 +51,16 @@ def addToDict(tempFile, genLand, spliceD, seq):
5151
elif chars[i]=="N":
5252
if l[2]+";"+str(curLoc) in spliceD:
5353
if spliceD[l[2]+";"+str(curLoc)] > curLoc + int(num[i]):
54-
pos = int(round(int(curLoc)/5)*5)
55-
size = int(round(int(num[i])/5)*5)
54+
pos = int(curLoc)
55+
size = int(num[i])
5656
spliceD[l[2]+";"+str(pos)] = size
57-
spliceD[l[2]+";"+str(pos+size)] = size+5
57+
spliceD[l[2]+";"+str(pos+size)] = size
5858
else:
59-
pos = int(round(int(curLoc)/5)*5)
60-
size = int(round(int(num[i])/5)*5)
59+
pos = int(curLoc)
60+
size = int(num[i])
6161
spliceD[l[2]+";"+str(pos)] = size
6262
#Adding splice in reverse direction
63-
spliceD[l[2]+";"+str(pos+size)] = -1*(size+5)
63+
spliceD[l[2]+";"+str(pos+size)] = -1*(size)
6464
curLoc = curLoc + int(num[i])
6565

6666
#Used to get counts in regions around multimapped reads
@@ -132,17 +132,15 @@ def getArray(read, winSize, genLand, spliceD):
132132
#Non-spliced array
133133
else:
134134
array = []
135-
pos = int(round(int(read[3])/5)*5)
135+
pos = int(read[3])
136136
k = pos-math.floor(winSize/2)
137137
while k < int(pos)+math.floor(winSize/2):
138-
k = round(k/5)*5
139138
key = read[2] + ";" + str(k)
140139
#Seeing if current pos in genetic landscape
141140
if key in genLand:
142141
array.append(genLand[key])
143142
else:
144143
array.append(0)
145-
k = k + 5
146144
return array
147145

148146

@@ -159,7 +157,7 @@ def readAssign(rBlock, samOut, winSize, genLand, model, cnn_scores, rc, rmz, mod
159157
#Find closest 100 window, use that score instead if it's already been assigned, saves time
160158
pos = i[2]+str(round(int(i[3])/100)*100)
161159
if pos in cnn_scores:
162-
scores_nn.append(cnn_scores[pos])
160+
#scores_nn.append(cnn_scores[pos])
163161
allZ = False
164162
else:
165163
countArray = getArray(i, winSize, genLand, spliceD)
@@ -719,7 +717,7 @@ def readAssignPE(rBlock, rBlock2, samOut, winSize, genLand, model, cnn_scores, r
719717
#Find closest 100 window, use that score instead if it's already been assigned, saves time
720718
pos = i[2]+str(round(int(i[3])/100)*100)
721719
if pos in cnn_scores:
722-
scores_nn.append(cnn_scores[pos])
720+
#scores_nn.append(cnn_scores[pos])
723721
allZ = False
724722
else:
725723
countArray = getArray(i, winSize, genLand, spliceD)

0 commit comments

Comments
 (0)