Skip to content

Commit 1392d5e

Browse files
committed
fix the way to pass data to add_chrom_data, and allow percent=0 while subsampling
1 parent 016421b commit 1392d5e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

MACS3/Signal/PairedEndTrack.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,9 @@ def pileup_bdg(self,
11741174
v = pv['v']
11751175
v = v * scale_factor
11761176
v[v < baseline_value] = baseline_value
1177-
bdg.add_chrom_data(chrom, pv['p'], v)
1177+
bdg.add_chrom_data(chrom,
1178+
pyarray('i', pv['p']),
1179+
pyarray('f', v))
11781180
return bdg
11791181

11801182
@cython.ccall
@@ -1310,7 +1312,7 @@ def sample_percent(self,
13101312
new_locs: cnp.ndarray
13111313
new_bars: cnp.ndarray
13121314

1313-
assert 0.0 < percent <= 1.0, "percent must be in (0, 1]"
1315+
assert 0.0 <= percent <= 1.0, "percent must be in [0, 1]"
13141316
chrnames = sorted(self.get_chr_names())
13151317

13161318
# Setup shuffling logic like PETrackI
@@ -1384,7 +1386,7 @@ def sample_percent_copy(self,
13841386
new_locs: cnp.ndarray
13851387
new_bars: cnp.ndarray
13861388

1387-
assert 0.0 < percent <= 1.0, "percent must be in (0, 1]"
1389+
assert 0.0 <= percent <= 1.0, "percent must be in [0, 1]"
13881390
chrnames = sorted(self.get_chr_names())
13891391

13901392
# Setup shuffling logic like PETrackI

0 commit comments

Comments
 (0)