-
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
filterPolarity #388
Comments
Thank you for your report @zeehio. Firstly, I suppose we should indeed add a function I will let @jotsetung also chime in, put I spotted an issue in your function (which might be a false positive though): filterPolarity <- function(object, polarity.) {
if (missing(polarity.)) return(object)
polarity. <- as.numeric(polarity.)
object[MSnbase::polarity(dataset_not_dia) %in% polarity.] ## should be object, rather than dataset_no_dia
} Could you confirm if that's the reason for the lack of effective filtering, or if it's only a typo. |
That On my own code |
I have added the method to |
Thank you for your time and efforts on this package.
My apologies if I am overlooking something obvious (I am a newcomer here). If that is the case, feel free to tell me and I will close the issue.
I found out I needed a
filterPolarity
function and I wonder if it would be worth including afilterPolarity
function in yourMSnbase
package. Here is my use case and a demo implementation:Without polarity filtering
Loading a single sample and plotting a region, without
filterPolarity
, both polarities appear mixed:With polarity filtering
Based on
MSnbase::filterMsLevel
I wrote thisfilterPolarity
function.Filtering the polarity I can easily see the positive and negative polarities:
Is there a reason why there is not a
filterPolarity
function inMSnbase
? I feel I am missing something obvious, but I'd rather ask just in case...Thanks
The text was updated successfully, but these errors were encountered: