-
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
C-level constructor breaks RMassBank #163
Comments
First run of tests went OK: library(MSnbase)
library(msdata)
mzf <- c(system.file("microtofq/MM14.mzML", package = "msdata"),
system.file("microtofq/MM8.mzML", package = "msdata"))
f <- msdata::proteomics(full.names = TRUE, pattern = "TMT_Erwinia")
## readMSData2
for (i in 1:7500) {
if (i %% 200 == 0)
cat(i, "\n")
res <- readMSData2(f, verbose = FALSE)
sp <- spectra(res)
sp <- res[[12]]
res <- readMSData2(mzf, verbose = FALSE)
sp <- spectra(res)
sp <- res[[12]]
} Next I'll check the |
Would you mind using both files in f <- msdata::proteomics(full.names = TRUE) The new one has MS1, 2, and 3 spectra. |
No, not again! library(MSnbase)
library(msdata)
f <- msdata::proteomics(full.names = TRUE, pattern = "TMT_Erwinia")
## readMSData
for (i in 1:10000) {
if (i %% 200 == 0)
cat(i, "\n")
res <- readMSData(f)
sp <- spectra(res)
sp <- res[[12]]
} I get agani randomly: Reading 451 MS2 spectra from file TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.gz
|============================================================ | 86%Error in (function (x) : attempt to apply non-function
|======================================================================| 100%
Creating 'MSnExp' object I'll try again |
OK, I found a workaround: I also run the |
But we need the versions - see |
Agree, it's just strange that this solves these random errors |
Do you the I would be compelled to use the C constructor in The biggest problem is that the current code stops anyone to re-use these classes :-/. |
No, I don't use I also prefer the C-constructors, but I would really like to know what's going on there. I'll try some more stuff, e.g. removing the |
In an email, you mentioned positive results with moving |
Yes I will, just want to run more tests on that. |
I suggest we create a variable in |
I would prefer you do that; you've got the better overview over all classes. In the meantime I'll try also a different approach; let's hope that that works as it would be much easier (no hacks in C). |
The alternative approach didn't work; I thought bypassing the So, it will be the C-hack. The tracking of class versions in |
Versions in It's not only a C-level hack. We also need to set them in the R-level constructors. May be it's worth updating the validity method of all classes to make sure the |
Yes, that would be great. Can you then push the changes as soon as you have the |
Will have to pickup my F1 from school soon, but will get started tonight. |
Things do become a bit messy - defining the version in the |
I don't think we can check in the |
It depends when the |
But, from R Programming for Bioinformatics (R Gentleman):
As in the example of |
But, once set in the |
Agree. |
There are now many unexpected side effects and errors that creep up since I did this last change. I am going to revert back, setting the version in the prototype (I don't want to break everything now), and proceed with setting the version in the |
That's strange. I'll add it to the |
I'm on it. Yes, spectra classes are the most important, and they don't rely on any other classes. |
Just pushed dc5299f |
o Add class versions to Spectrum1 and Spectrum2 objects created with the C-level constructors (issue #163). o Remove new("Versioned") calls from prototypes of Spectrum, Spectrum1 and Spectrum2. o Add class version information in initialize methods of Spectrum, Spectrum1 and Spectrum2. o Add unit tests ensuring correct class versions.
I've pushed now the fixes for I'm running the torture tests on the new code. I'll update once that's done. |
These errors are completely crazy - I get one complaining about |
One error was in > odmse[[1]]
Error in strsplit(z, split = ".", fixed = TRUE) : non-character argument
Calls: [[ ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted Changing it to .versionToNum <- function(z) z@.Data seems to fix it. Moving on to others... |
Quite a few errors because of > classVersion(aa[[1]])
Spectrum2 Spectrum
"0.3.0" "0.4.0"
> classVersion(msx[[1]])
Spectrum Spectrum2
"0.4.0" "0.2.0" |
Ah, sorry. The |
I would have thought so too, but after some testing, it doesn't look like it. I now set both |
I think we not opened a whole new can of worms: > classVersion("Spectrum1")
[1] "Versioned; no version string" which breaks |
I didn't knew that > classVersion(new("Spectrum1"))
Spectrum1 Spectrum
"0.3.0" "0.4.0" It would make more sense to me, although in the |
The only way out I see now it to replace Update - apparently, that's every slot! |
Actually, easiest is no to bump class version number - pathetic, but that's what I am going to do now :-( |
@jotsetung - there's a problem with C-level constructed class versions > f <- msdata::proteomics(full.names = TRUE, pattern = "TMT_Erwinia_1")
> inmem2 <- readMSData(f, centroided = NA, verbose = FALSE) ## That's the MS 2 data.
> ondisk2 <- readMSData2(f, msLevel = 2, verbose = FALSE)
> all.equal(inmem2[[1]], ondisk2[[1]])
[1] "Attributes: < Component “.__classVersion__”: Names: 2 string mismatches >"
[2] "Attributes: < Component “.__classVersion__”: Component 1: Modes: numeric, list >"
[3] "Attributes: < Component “.__classVersion__”: Component 1: Lengths: 3, 1 >"
[4] "Attributes: < Component “.__classVersion__”: Component 1: target is numeric, current is list >"
[5] "Attributes: < Component “.__classVersion__”: Component 2: Modes: numeric, list >"
[6] "Attributes: < Component “.__classVersion__”: Component 2: Lengths: 3, 1 >"
[7] "Attributes: < Component “.__classVersion__”: Component 2: target is numeric, current is list >"
> classVersion(inmem2[[1]])
Spectrum Spectrum2
"0.4.0" "0.2.0"
> classVersion(ondisk2[[1]])
Spectrum2 Spectrum
"c(0, 2, 0)" "c(0, 4, 0)" Could you have a look? |
Fixed in cc9ee4e. |
Checking package now - hoping to be able to close soon. Where all your torture tests positive? |
Torture tests look good. they are at iteration 3000 for |
I have added a |
well, I still get one error in the |
Yes - I will comment that unit test for now and document this in a new issue, so that we can tackle it if/when we hear back for the Bioc experts. |
Just an update on the torture test:
|
And yet... |
Well, that calls for more torture tests... I'll run some more. |
At least, it seems that the errors are becoming much rarer. It might also be dependent on the environment - I can imaging the Bioc servers being heavily loaded during these checks. |
Have you seen this error report in unit tests:
Looks familiar! The package doesn't depend on |
well, yes. |
* master: (24 commits) temporarily disable updateObject test - see issue #166 torture test script Fix class version problem for Spectrum1 and Spectrum2 new lines cleanup set version in initialise for Spectum only Use getClassVersion function to get class versions. Add class version to C-constructors set Spectrum class in initialize revert to previous NAnnotatedDataFrame fix new error quantifying msnexp with empty phenodata set class version in NAnnotatedDataFrame initialize fix iPQF unit test to take into account new class versions fix MSnProcess and MIAPE initialize to set class version earlier set class version in MIAPE initialize new rcpp attribs class version helper functions MSnProcess has class set in initialize and validity checks for version Initiating removal or new() class version construction inside prototype. Tix removeReporters,OnDiskMSnExp Reverting to old initialize,Spectrum (see issue #163) ... From: Laurent <[email protected]> git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@122190 bc3139a8-67e5-0310-9ffc-ced21a209358
* master: (24 commits) temporarily disable updateObject test - see issue #166 torture test script Fix class version problem for Spectrum1 and Spectrum2 new lines cleanup set version in initialise for Spectum only Use getClassVersion function to get class versions. Add class version to C-constructors set Spectrum class in initialize revert to previous NAnnotatedDataFrame fix new error quantifying msnexp with empty phenodata set class version in NAnnotatedDataFrame initialize fix iPQF unit test to take into account new class versions fix MSnProcess and MIAPE initialize to set class version earlier set class version in MIAPE initialize new rcpp attribs class version helper functions MSnProcess has class set in initialize and validity checks for version Initiating removal or new() class version construction inside prototype. Tix removeReporters,OnDiskMSnExp Reverting to old initialize,Spectrum (see issue #163) ... From: Laurent <[email protected]> git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@122190 bc3139a8-67e5-0310-9ffc-ced21a209358
* master: (24 commits) temporarily disable updateObject test - see issue #166 torture test script Fix class version problem for Spectrum1 and Spectrum2 new lines cleanup set version in initialise for Spectum only Use getClassVersion function to get class versions. Add class version to C-constructors set Spectrum class in initialize revert to previous NAnnotatedDataFrame fix new error quantifying msnexp with empty phenodata set class version in NAnnotatedDataFrame initialize fix iPQF unit test to take into account new class versions fix MSnProcess and MIAPE initialize to set class version earlier set class version in MIAPE initialize new rcpp attribs class version helper functions MSnProcess has class set in initialize and validity checks for version Initiating removal or new() class version construction inside prototype. Tix removeReporters,OnDiskMSnExp Reverting to old initialize,Spectrum (see issue #163) ... From: Laurent <[email protected]> git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@122190 bc3139a8-67e5-0310-9ffc-ced21a209358
Emma reported the following error on the bioc-devel mailing list.
As discussed on the email thread, this seems to be the result of calling the C-level constructors in the
Spectrum2
(andSpectrum1
)initialize
methods. As a consequence, will probably revert back to the oldinitialize,Spectrum
method.The text was updated successfully, but these errors were encountered: