-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Peaks #320
Remove Peaks #320
Conversation
That's great, thanks. I won't have time either, but no hurry. Let me know if you prefer this PR to be merged now wait for #252. |
Nice @sgibb 👍 |
Be aware that
Also it sometimes fails (the original
Note that with
H. |
Thanks @hpages for following up! |
@hpages thanks for this great comment! Indeed the utils.removePeaks <- function(int, t) {
int <- c(0L, int, 0L)
d <- diff(int > 0L)
s <- which(d == 1L) + 1L
e <- which(d == -1L)
for (i in seq_along(s)) {
j <- s[[i]]:e[[i]]
if (all(int[j] <= t)) {
int[j] <- 0L
}
}
int[seq_len(length(int) - 2L) + 1L]
} But you are right that the @lgatto and @jotsetung sorry for this stupid PR and all its inconvenience (and I said it would be a non-destructive PR ...) |
This is a work-in-progress PR.
After
IRanges
were replaced byIRangesList
inutils.removePeaks
in d519ec5 I recognized a large slow down of this function. So I started to rewrite this function withoutIRanges
(in favour of #201 I removedIRanges
dependency completely, avoidingIRanges
is faster than the recently merged solution by @hpages but uses afor
loop again, see below).I also wanted to address the issue #252 with this PR but unfortunately I won't have time the next days (maybe weeks) to finish this PR. If anybody wants to take over please feel free to do so.