Spectra
Spectra copied to clipboard
Function to find/visualise contaminants
In PR #259, I included a message about mz being sorted. As pointed by @sgibb, we haven't done so in other instances, and I suppose it doesn't bring much anyway given that a vector logical is always returned, irrespective of the number of contained mz values.
I thought it would be useful to have another function (or update that one) to check for one or multiple contaminants in a Spectra
object, something like this
I imagine a function contaminantMz(x, mz = c(...))
that returns a logical matrix of dimensions length(x) by length(mz).
Referring back to this comment, in this case, I thought it would be worth mentioning that mz would be sorted if they weren't. But even here, if we name our colnames, it might not even be needed.