Skip to content

Commit

Permalink
Update utils.py to fix problem in pos
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoesgithub authored Jul 3, 2024
1 parent 808f63e commit 9f70ad8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions deltasplice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,18 @@ def write_splice_sites(fouts, CHROM, NAME, STRAND, TX_START, TX_END, SPECIES, Yp
y_t = np.copy(Yt[i, :, c])
y_t[np.isnan(y_t)] = 1
idx = np.nonzero(y_t > 1e-10)[0] # positions of true splice sites

EL=(tx_end-tx_start-y_t.shape[0])//2
for j in idx:
pos = (tx_start + tx_end)//2

if strand=="+":
pos = tx_start+j+EL+1
else:
pos=tx_end-EL-j
yt = [str(Yt[i, j, c])]
yp = [str(Yp[i, j, c])]

key=f"{species}_{chrom}_{pos}_{name}_{strand}"
if key in exist_combine:
continue
exist_combine.add(key)
line = "\t".join(
map(
str,
Expand Down

0 comments on commit 9f70ad8

Please sign in to comment.