-
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
Could we speedup validObject
for MSnExp
and Spectrum
classes?
#183
Comments
There is a C-level constructor, that we use for |
I already use |
I can't think of a solution other than not calling |
I think we do have something like that for the |
An alternative would be to add a C-level validity check function for |
We could have a |
For For |
Could you clarify here - just looked into |
This would be a good thing for .firstMsLevel <- function(object) {
if (inherits(object, "OnDiskMSnExp")) msLevel(object)[1]
else msLevel(object[[1]])
} Comments, suggestions? |
great! was about to write about the possible problem with |
Have added |
Using |
While working on
synapter
we recognise that creatingMSnExp
object takes a lot of time. Fairly enough the PLGS data format is stupid (an xml file with something like<spectrum>tab delim values</spectrum>
) and we can't useOnDiskMSnExp
. Reading the file and generating theSpectrum2
objects took 50 minutes (see minutes 22 to 70 on the figure below; ~ 25 minutes reading the file and ~ 25 minutes creating theSpectrum2
objects). Subsequently creating anMSnExp
object from theseSpectrum2
objects took 45 minutes (70 to 115 on the figure below). The vast majority is spend invalidObject
.For a smaller dataset (36000 spectra)
validObject
needs 40 seconds on my laptop. By not callingvalidObject
it reads the spectra in 100 instead of 140 seconds.It is eye-catching that we call
msLevel
8 times (which takes nearly 8 * 0.5 seconds; 1. valid ofpSet
; multiple times in.header
, e.g.precursorMz
,precursorCharge
...).header
needs nearly 10 seconds (which could maybe reduced a little bit).But what eats most time is
isVersioned
(nearly 14 seconds). Unfortunately most of the time is spend in the S4 class system/method dispatching. So we can't change much ...Any ideas to improve this?
The text was updated successfully, but these errors were encountered: