Skip to content

[Bioc-devel] RMassBank build error

8 messages · Stravs, Michael, Laurent Gatto, Kasper Daniel Hansen +1 more

#
an update:

I've switched back to the "default" initialize methods for Spectrum1 and Spectrum2 objects in MSnbase (not implemented in C) and with these installing RMassBank seems to work. 
I have however now to run some intense torture tests on MSnbase to ensure that we don't run again into the random memory problems that we had in MSnbase (issue https://github.com/lgatto/MSnbase/issues/138)

jo
#
On 7 October 2016 21:30, Rainer Johannes wrote:

            
I have done the same thing, which also needed addressing some unit
tests. I will push these updates to master for after a final package
check, but wait for the results of your intense torture tests before
committing to svn.

Laurent

  
    
1 day later
#
Hi all,

I now have all packages installed to test things and can reproduce the 
problem. I must confess that I don't have a deep understanding on how S4 
initialization works, so solution attempts on my side are very 
trial-and-errory.

I will have to look into the workings of these initialization methods 
anyway in the future. The RMassBank version currently on Bioc-devel uses 
the default constructor (i.e. doesn't actually define an "initialize" 
method).

However, one of my development versions has an initialize method, which 
I introduced to work around a bug with Versioned initialize (see  my 
question here [1], the reply [2], and my current code [3]). That one is 
*also* incompatible with the new MSnbase constructors because of some 
argument mapping issues (but there might also be a workaround for that.)

[1] https://stat.ethz.ch/pipermail/bioc-devel/2016-January/008528.html
[2] https://stat.ethz.ch/pipermail/bioc-devel/2016-January/008576.html
[3] 
https://github.com/MassBank/RMassBank/blob/s4power/R/SpectrumMethods.R#L124
On 07.10.2016 22:34, Laurent Gatto wrote:
#
Dear Michael and RMassBank developers,
On 9 October 2016 15:53, Stravs, Michael wrote:

            
I don't think that your initialize method will work as it is, because it
passess arguments to callNextMethod, which doesn't have them. But, to be
honest, I don't think that any intialize method will sort the current
problem.

I am not sure how to best handle to problem. To sort your problem, we
(the MSnbase maintainers) could revert to our old initialize,Spectrum
method, but some very weird bugs (in R? in some very low-level C code?)
result in random crashes. We are looking for something else.

Anyway, if we don't manage to find an acceptable solution for MSnbase, I
will submit an RMassBank patch that will sort the error (and other
things resulting from MSnbase improvements) out. What would be the best
way to submit a patch - email, a pull request to a github repo?

Best wishes,

Laurent

  
    
#
You (and everyone else) should not construct new instances by using new()
together with prototype.  It is true that we did that long time ago in
Biobase, but I think the collective lesson is that it is not really
flexible/stable enough (ok, bad wording, but it is Sunday night).   What we
recommend now is to create a constructor function, usually the class name,
like GRanges().  Of course, inside the constructor you would then call
new(), which works ok for simple cases.
On Sun, Oct 9, 2016 at 4:02 PM, Laurent Gatto <lg390 at cam.ac.uk> wrote:

            

  
  
#
Hi Laurent,
The method did work with MSnbase until the recent constructors switch... The whole point of the method was to make a copy constructor possible by explicitely assigning the arguments ("Versioned" has a problem), otherwise it would do something strange.

But yes, I don't think it will solve the current problem.
But that's weird as is, no? I thought your constructor did only relatively mundane stuff, so if this causes problems then it shouldn't be MSnbase's responsibility to fix them and they are alarming for every R programmer solution out there...
A pull request to github.com/MassBank/RMassBank would be best I think. Even though the version on there is possibly newer than the one on Bioc.

I am currently really busy with urgent stuff and therefore RMassBank development is on the far-backburner but there's a ton of things I'd like to implement. Is there a summary of MSnbase improvements that I could look at, since there were apparently quite many? Maybe there's other things we could benefit from.

Also, will there be a problem with regards to serialization? We relied quite heavily on load()ing and save()ing large collections of RMassBank objects including MSnbase spectra; is there much I will need to consider in the upgrade path when loading?

Thanks and best wishes,
-Michele
#
I followed Kasper's suggestion and removed the new("Versioned") calls from the prototype of the Spectrum, Spectrum1 and Spectrum2 classes and added the corresponding calls (e.g. classVersion(.Object)["Spectrum1"] <- "0.2.0") to the objects' initialize methods. With that setup I don't get (thus far) the random errors in MSnbase.

I would suggest to update the help page of "Versioned", as there the usage of Versioned was described exactly as we did in MSnbase.

cheers, jo
#
On 10 October 2016 08:46, Stravs, Michael wrote:

            
I don't think we are at that stage yet, and I wouldn't make any strong
claims about there being a bug in R. MSnbase and it's reliance on mzR
and proteowizard opens up many possibilities for bugs and weirdness.
Latest news is that we should be able to fix this on our side. If not, I
have an RMassBank patch ready to be sent as a github PR.

(I would suggest you add a URL field in your DESCRIPTION file, to
document that github repo instead of the Bioconductor-mirror one.)
The NEWS file (news(package = "MSnbase")) and the benchmarking vignette
[1] are good places to see recent changes and read about the the new
version. In a nutshell, there's now an on-disk back-end, that does not
read the spectrum data into memory when creating the MSnExp raw data
object, but only on demand, when actually needed. The benefits are
described in the vignette.

This has a big effect on serialisation: as we don't have support to
write mzML data, serialisation is not possible with on-disk data. That's
however not too much of a problem because (1) the in-memory back-end is
still available (and will remain available, albeit probably won't
benefit from recent developments as much as the new one) and (2) it is
possible to go from on-disk to in-memory before saving.

I will try to document differences more systematically in this issue [2]
in a first instance and then in the package documentation.

Best wishes,

Laurent

[1] http://bioconductor.org/packages/devel/bioc/vignettes/MSnbase/inst/doc/benchmarking.html
[2] https://github.com/lgatto/MSnbase/issues/165