-
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
Failing isCentroidedFromFile unit test #338
Comments
I can also not reproduce it. I tested with > baseUrl <- "https://raw.githubusercontent.com/HUPO-PSI/mzTab/master/examples/"
>
> ## a list of mzTab objects
> mzt <- sapply(file.path(baseUrl, fls), MzTab)
Warning in file(con, "r") :
cannot open URL 'https://raw.githubusercontent.com/HUPO-PSI/mzTab/master/examples//Cytidine.mzTab': HTTP status was '404 Not Found'
Error in file(con, "r") :
cannot open the connection to 'https://raw.githubusercontent.com/HUPO-PSI/mzTab/master/examples//Cytidine.mzTab'
Calls: sapply -> sapply -> lapply -> FUN -> readLines -> file
Execution halted
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘testthat.R’
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
- 131.1382 +/- 0.002 (#BC80BD)
Object of class "Spectrum1"
Retention time: 0:0
MSn level: 1
Total ion count: 684
Polarity: 1
══ testthat results ═══════════════════════════════════════════════════════════
OK: 1974 SKIPPED: 8 FAILED: 4
1. Error: fileNames accessor MzTab (@test_fileNames.R#10)
2. Error: read MzTab data v 0.9 and 1.0 (@test_MzTab_09.R#8)
3. Error: MzTab creation and accessors (@test_MzTab.R#8)
4. Error: Conversion to MSnSetList (@test_MzTab.R#34)
Error: testthat unit tests failed
Execution halted but no error in the |
These errors you observe come from remote files that have unexpectedly changed location - this has been fixed on github. Thank you for testing. |
the only thing I've seen is that lines 27 and 33 produce warnings - eventually there is a limit in the number of allowed warnings in unit tests on the BioC build machines? expect_warning(cnt <- isCentroidedFromFile(microtofq_on_disk))
expect_identical(names(cnt), featureNames(microtofq_on_disk))
##
## subsetting
k <- sort(sample(length(microtofq_on_disk), 10))
xx <- microtofq_on_disk[k]
expect_warning(expect_identical(isCentroidedFromFile(xx), cnt[k])) |
I think I found the reason for the error: library("testthat")
library("MSnbase")
f <- c(system.file("microtofq/MM14.mzML", package = "msdata"),
system.file("microtofq/MM8.mzML", package = "msdata"))
microtofq_on_disk <- readMSData(f, mode = "onDisk")
cnt <- isCentroidedFromFile(microtofq_on_disk)
## For the first file centroiding information can be determined:
head(cnt)
F1.S001 F1.S002 F1.S003 F1.S004 F1.S005 F1.S006
TRUE TRUE TRUE TRUE TRUE TRUE
## But for the second not:
tail(cnt)
F2.S193 F2.S194 F2.S195 F2.S196 F2.S197 F2.S198
NA NA NA NA NA NA
## If k represents indices of spectra from the first and the second file it works:
k <- c(1:5, 300:305)
xx <- microtofq_on_disk[k]
expect_identical(isCentroidedFromFile(xx), cnt[k])
## But if k represents indices of spectra only of the second file:
k <- 300:310
xx <- microtofq_on_disk[k]
expect_identical(isCentroidedFromFile(xx), cnt[k])
Error: isCentroidedFromFile(xx) not identical to cnt[k].
Names: 'is.NA' value mismatch: 0 in current 11 in target
In addition: Warning message:
In .isCentroidedFromFile(f) : NAs introduced by coercion
Summarizing, the solution would be to add expect_identical(unname(isCentroidedFromFile(xx)), unname(cnt[k])) |
Thank you! |
The last unit test in
test_centroided.R
currently fails withSee also https://master.bioconductor.org/checkResults/3.7/bioc-LATEST/MSnbase/malbec2-checksrc.html
I have issues reproducing this interactively.
@jotsetung - could you have a go, please.
The text was updated successfully, but these errors were encountered: