Skip to content

Commit

Permalink
ignore distance limits with trans
Browse files Browse the repository at this point in the history
  • Loading branch information
Phlya committed Oct 31, 2024
1 parent a9e5cf0 commit 592673c
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions coolpuppy/coolpup.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@ def __init__(
self.mindist = mindist
if self.trans:
warnings.warn("Ignoring mindist when using trans", stacklevel=2)
self.mindist = 0
if maxdist is None:
self.maxdist = np.inf
else:
self.maxdist = maxdist
if self.trans:
warnings.warn("Ignoring maxdist when using trans", stacklevel=2)
self.maxdist = np.inf
self.local = local
self.subset = subset
self.seed = seed
Expand Down Expand Up @@ -437,14 +439,9 @@ def _control_regions(self, intervals2d, nshifts=0):
]
+ shift[:, np.newaxis]
)
control_intervals[
["stBin1", "endBin1", "stBin2", "endBin2"]
] = control_intervals[
["stBin1", "endBin1", "stBin2", "endBin2"]
] + np.round(
shift[:, np.newaxis] / self.resolution
).astype(
int
control_intervals[["stBin1", "endBin1", "stBin2", "endBin2"]] = (
control_intervals[["stBin1", "endBin1", "stBin2", "endBin2"]]
+ np.round(shift[:, np.newaxis] / self.resolution).astype(int)
)
intervals2d["kind"] = "ROI"
control_intervals["kind"] = "control"
Expand Down Expand Up @@ -1813,11 +1810,15 @@ def pileupsByDistanceWithControl(
0,
"separation",
normalized_pileups["distance_band"].apply(
lambda x: x
if x == "all"
else f"{x[0]/1000000}Mb-\n{x[1]/1000000}Mb"
if len(x) == 2
else f"{x[0]/1000000}Mb+"
lambda x: (
x
if x == "all"
else (
f"{x[0]/1000000}Mb-\n{x[1]/1000000}Mb"
if len(x) == 2
else f"{x[0]/1000000}Mb+"
)
)
),
)
# Move "all" to the bottom while sorting the distances
Expand Down Expand Up @@ -1893,11 +1894,15 @@ def pileupsByStrandByDistanceWithControl(
0,
"separation",
normalized_pileups["distance_band"].apply(
lambda x: x
if x == "all"
else f"{x[0]/1000000}Mb-\n{x[1]/1000000}Mb"
if len(x) == 2
else f"{x[0]/1000000}Mb+"
lambda x: (
x
if x == "all"
else (
f"{x[0]/1000000}Mb-\n{x[1]/1000000}Mb"
if len(x) == 2
else f"{x[0]/1000000}Mb+"
)
)
),
)
# Move "all" to the bottom while sorting the distances
Expand Down

0 comments on commit 592673c

Please sign in to comment.