kuwisdelu / Cardinal

Mass spectrometry imaging toolbox
http://www.cardinalmsi.org
Artistic License 2.0
42 stars 14 forks source link

Unable to read imzML #36

Closed Numliap closed 5 months ago

Numliap commented 5 months ago

Hi Kylie,

In previous version, I can read imzML without any issue but after install version 3.6. I got this error:

readMSIData("test.imzML") parsing imzML file: ‘/home/msi/test.imzML’ Error in find_term(value, obo = obo, value = "name") : could not resolve ‘meanndering’ to a valid term; did you mean one of: [no matches]?

I did not know if this will help but I try using CardinalIO::parseImzML("test.imzML", ibd = TRUE) This function works fine. Thank you in advance.

Watit

kuwisdelu commented 5 months ago

@Numliap

If the ".imzML" file can't be shared, can you please provide (1) the output of traceback() immediately after the error, and (2) the output of sessionInfo()?

Thanks.

Numliap commented 5 months ago

Thank you for the quick response. Here is the traceback:

traceback() 15: stop("could not resolve ", sQuote(term), " to a valid term;", " did you mean one of: ", possible, "?") 14: find_term(value, obo = obo, value = "name") 13: [[<-(*tmp*, nm, value = c(name = "meanndering")) 12: [[<-(*tmp*, nm, value = c(name = "meanndering")) 11: .new_ImzMeta(spectrumType = .find_single_term_or_NULL(fileContent, tags[["spectrumType"]], "ms", "name"), spectrumRepresentation = .find_single_term_or_NULL(fileContent, tags[["spectrumRepresentation"]], "ms", "name"), contactName = .find_single_term_or_NULL(contact, tags[["contactName"]], "ms", "value"), contactAffiliation = .find_single_term_or_NULL(contact, tags[["contactAffiliation"]], "ms", "value"), contactEmail = .find_single_term_or_NULL(contact, tags[["contactEmail"]], "ms", "value"), instrumentModel = .find_single_term_or_NULL(ic1, tags[["instrumentModel"]], "ms", "name"), ionSource = .find_single_term_or_NULL(ic1[["componentList"]][["source"]], tags[["ionSource"]], "ms", "name"), analyzer = .find_single_term_or_NULL(ic1[["componentList"]][["analyzer"]], tags[["analyzer"]], "ms", "name"), detectorType = .find_single_term_or_NULL(ic1[["componentList"]][["detector"]], tags[["detectorType"]], "ms", "name"), lineScanSequence = .find_single_term_or_NULL(ss1, tags[["lineScanSequence"]], "ims", "name"), scanPattern = .find_single_term_or_NULL(ss1, tags[["scanPattern"]], "ims", "name"), scanType = .find_single_term_or_NULL(ss1, tags[["scanType"]], "ims", "name"), lineScanDirection = .find_single_term_or_NULL(ss1, tags[["lineScanDirection"]], "ims", "name"), pixelSize = .find_single_term_or_NULL(ss1, tags[["pixelSize"]], "ims", "value")) 10: .convert_ImzML_to_ImzMeta(from) 9: asMethod(object) 8: as(parse, "ImzMeta") 7: initialize(value, ...) 6: initialize(value, ...) 5: new("MSImagingArrays", spectraData = spectraData, elementMetadata = pixelData, experimentData = experimentData, centroided = centroided, continuous = continuous, metadata = metadata, processing = list()) 4: MSImagingArrays(spectraData, pixelData = pixelData, experimentData = as(parse, "ImzMeta"), centroided = centroided, continuous = continuous) 3: .read_imzML(path, parse.only = parse.only, check = check, ...) 2: readImzML(file, ...) 1: readMSIData("test.imzML")

Here is the session info:

sessionInfo() R version 4.4.0 (2024-04-24) Platform: aarch64-apple-darwin23.4.0 Running under: macOS Sonoma 14.4.1

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /opt/homebrew/Cellar/r/4.4.0_1/lib/R/lib/libRlapack.dylib; LAPACK version 3.12.0

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York tzcode source: internal

attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] Cardinal_3.6.0 S4Vectors_0.42.0 BiocParallel_1.38.0 BiocGenerics_0.50.0 ProtGenerics_1.36.0

loaded via a namespace (and not attached): [1] nlme_3.1-164 cli_3.6.2 rlang_1.1.3 DBI_1.2.2 tiff_0.1-12 png_0.1-8 RCurl_1.98-1.14 htmltools_0.5.8.1 [9] ontologyIndex_2.12 Biobase_2.64.0 locfit_1.5-9.9 grid_4.4.0 abind_1.4-5 bitops_1.0-7 fastmap_1.2.0 compiler_4.4.0
[17] codetools_0.2-20 CardinalIO_1.2.1 irlba_2.3.5.1 htmlwidgets_1.6.4 fftwtools_0.9-11 EBImage_4.46.0 lattice_0.22-6 digest_0.6.35
[25] matter_2.6.1 parallel_4.4.0 Matrix_1.7-0 tools_4.4.0 jpeg_0.1-10 biglm_0.9-2.1

kuwisdelu commented 5 months ago

@Numliap

Thanks! Looks like an issue that should be converted to a warning instead of an error in CardinalIO. I will fix it once I get a chance.

In the meantime, you can open the ".imzML" file in a plain text editor and do a search and replace for "meanndering" with "meandering" to fix the tag manually.

(There is a typo in the ".imzML" file.)

Numliap commented 5 months ago

Thank you very much! Really appreciate.