Skip to content

Commit

Permalink
Update PairedEndTrack.pyx
Browse files Browse the repository at this point in the history
Fix a bug while dealing with some chromosome only contains one read (pair). The size of new_locs after filtering dups should +1.
  • Loading branch information
taoliu committed Oct 9, 2015
1 parent a3438e8 commit 6d2bedb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MACS2/IO/PairedEndTrack.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ cdef class PETrackI:
i_dup = 0
locs = self.__locations[k]
size = locs.shape[0]
if size < 1:
if size <= 1:
new_locs = locs
else:
new_locs = np.zeros(self.__pointer[k], dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
dup_locs = np.zeros(self.__pointer[k], dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
new_locs = np.zeros(self.__pointer[k] + 1, dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
dup_locs = np.zeros(self.__pointer[k] + 1, dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
i_new += 1
n = 1

Expand Down Expand Up @@ -385,10 +385,10 @@ cdef class PETrackI:
i_new = 0
locs = self.__locations[k]
size = locs.shape[0]
if size < 1:
if size <= 1:
new_locs = locs
else:
new_locs = np.zeros( self.__pointer[k], dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
new_locs = np.zeros( self.__pointer[k] + 1, dtype=[('l','int32'),('r','int32')]) # note: ['l'] is the leftmost end, ['r'] is the rightmost end of fragment.
i_new += 1
n = 1 # the number of tags in the current location

Expand Down

0 comments on commit 6d2bedb

Please sign in to comment.