-
Notifications
You must be signed in to change notification settings - Fork 8
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
peak_detector_closest_hit_match() fails when all peaks discarded for a karyotype #10
Comments
Hi @bobamess thanks for the issue, I want to make sure you will be keeping using this tool happily! Jokes aside, that is a rare error I agree, but definitely easy to fix. I understand the logic of your suggestion, is there any chance you could share a toy dataset to replicate it? It would help me understand better what I am missing and how to return the expected structure, and also wether this event affects other tool's functions etc. If not, how about you make a pull request and implement the fix? |
Hi @caravagn
Then from CNAqc:::peak_detector_closest_hit_match()
And we get
This next example fails as all are discarded as described earlier
I can't think of exactly how to fix this and it may involve modifications to CNAqc:::analyze_peaks() after it calls CNAqc:::peak_detector_closest_hit_match() Thanks in advance of a fix |
Thanks, I would need the values for |
Sorry, forgot to include that. This should work:
and give you
|
I think I might have fixed that, meaning that I intercept - I think - the fact the case with
The second if should catch it. The thing I cannot understand is why the first did not force Also, now if the error propagates upstream I generate a general If you want me to look more into this, the ideal would be to have a CNAqc object to run. |
Yes, I had noticed that I'm not keen on an I would prefer if a warning could be issued and somehow the process enabled to continue with the sample pair included. Within the
If Presumably, if Having said that, it seems to me that when I've saved the
You should then be able to continue using this with
and get output with the error as below.
And also debug using code from Thanks again for trying to fix this. |
Thanks. It does not crash to me like that.
And in fact
Now if I notice your error message I see
This is due - I am pretty sure - to some older version of one of the My sessionInfo() is
Can you post me yours? |
Interesting!
After updating to CNAqc_0.1.1, and without updating tidyverse, it now works. The new sessionInfo() is now
I can see that other packages also got updated when updating CNAqc, including lifecycle and dplyr, but it's not clear to me why it now works? |
Mmmm I think it all stems from a major updated of one of the tidyverse packages, which introduced a different strategy to handle names of tibbles. I bumped into this in pretty much all of my packages. Glad that it now works; I will close the issue. |
I was happily using this very useful package, but then encountered a, possibly rare, event involving all peaks being discarded for a karyotype. Unfortunately, this event was not handled well causing the script to exit.
analyze_peaks()
callsCNAqc:::peak_detector_closest_hit_match()
which definesget_match()
asIn the, possibly rare, event of all peaks being discarded for a karyotype this results in
length(id_match) == 0
andget_match()
returnsNA
.Subsequently, with
matched_peaks = lapply(seq_along(expectation$peak), get_match)
we get
instead of the usual
And, after
matching = expectation %>% dplyr::bind_cols(Reduce(dplyr::bind_rows, matched_peaks))
we get
instead of the more usual
Thus, the following line
matching$offset = matching$peak - matching$x
then gives this error and warning and the script exits.
Possible solution:
Either
get_match()
should return the required structured object instead of plainNA
, orpeak_detector_closest_hit_match()
catches this event, skips the following lines and returns an empty list with the correct structure.The text was updated successfully, but these errors were encountered: