Loading my MSI data sets.

183 views
Skip to first unread message

Krista Berlin

unread,
Feb 21, 2022, 8:23:39 PM2/21/22
to Cardinal MSI Help
I'm a Cardinal novice and having trouble reading my data sets into MSI Data files for combining and processing. I can load my three data sets into Cardinal, but when I try to read them as MSIData files, only one of them was processed. I used the same file name strand, with the exception of the final file name, and I can't see where I went wrong in my code. I keep getting an error that the file does not exist. Any help would be greatly appreciated. 
Reading MSIData Error.PNG

Giulia Ricciardi

unread,
Feb 22, 2022, 8:04:03 AM2/22/22
to Cardinal MSI Help
Hi Krista,
when you get an error like that, there usually is a tiny spelling mistake somewhere along the code or a mismatch between the code you wrote and the actual filename.

In your case, you're trying to load the file named "MB_9AA_N_02012022_Sp13_3_NoProcessing.imzML" but I see in the folder that your file is actually named "MB_9AA_N_02012022_Sp13_3_NoProcessng.imzML", with the word PROCESSNG that is missing an "i".

Try to change the filename to "processIng" or fix the code by typing "processng" and see if it works.
Hope this helped!

Giulia

Krista Berlin

unread,
Feb 23, 2022, 1:12:04 PM2/23/22
to Cardinal MSI Help
Giulia,

My apologies for my delayed response, I was out of the lab/office yesterday. Your suggestion worked! Thank you so much! I thought it was something simple like that, I just couldn't see it. Unfortunately, I have another issue loading my data. When I tried to read the MSIData file I got this error:

Error: BiocParallel errors
  1 remote errors, element index: 20
  0 unevaluated and other errors
  first remote error: failed to read data elements

Krista

Krista Berlin

unread,
Feb 23, 2022, 2:02:37 PM2/23/22
to Cardinal MSI Help
I also get this error when I try to combine MSI data sets:

> combinedRun <- Cardinal::combine(mse_2_2, mse_3_2, centroided=TRUE)
Error in h(simpleError(msg, call)) : 
error in evaluating the argument 'y' in selecting a method for function 'combine': error in evaluating the argument 'y' in selecting
a method for function 'combine': error in evaluating the argument 'args' in 
selecting a method for function 'do.call': argument "y" is missing, with no default

I saw someone else have this error, but I didn't see how it was resolved.

Krista

Dmitry Leontyev

unread,
Feb 23, 2022, 3:15:24 PM2/23/22
to Cardinal MSI Help
Hi Krista,

The error with combinedRun is related to setting the data as centroided. You don't need to set centroided=TRUE when calling combine or in readMSIData, you need set the data as centroided after reading them it in. See my example below.

Hope this helps,
Dmitry


-------------CODE----------------------
#defines paths
pathtest1 <- "C:/Users/Dima/Downloads/DANdimer.imzML"
pathtest2 <- "C:/Users/Dima/Downloads/LPC160.imzML"

#loads data
test1 <- readMSIData(pathtest1, mass.range=c(730,830), resolution=100, units="ppm", attach.only=TRUE)
test2 <- readMSIData(pathtest2, mass.range=c(730,830), resolution=100, units="ppm", attach.only=TRUE)

#sets centroided as TRUE, which is necessary for combination and combines runs
centroided(test1) <- TRUE
centroided(test2) <- TRUE
combinedRun <- Cardinal::combine(test1,test2)

Krista Berlin

unread,
Feb 23, 2022, 5:03:09 PM2/23/22
to Cardinal MSI Help

Dmitry,

Thank you so much for your help. I was referring to your error message that I couldn't decipher. LOL 

One other question, what is the highlighted code section below in reference to?
test1 <- readMSIData(pathtest1, mass.range=c(730,830), resolution=100, units="ppm", attach.only=TRUE)

Krista

Krista Berlin

unread,
Feb 25, 2022, 10:49:00 AM2/25/22
to Cardinal MSI Help
Dmitry,

I just wanted to follow up with you. Why do you include attach.only=TRUE when giving data set parameters to an MSI file?

Krista

Dmitry Leontyev

unread,
Feb 25, 2022, 10:59:48 AM2/25/22
to Cardinal MSI Help
Krista,

I forget exactly what that does, but the manual mentions it and I think I used it because it was in the examples.

-Dmitry

Krista Berlin

unread,
Feb 25, 2022, 12:43:53 PM2/25/22
to Cardinal MSI Help
Giulia,

I'm still getting this error message when I try to read my first data set as an MSI file.

Error: BiocParallel errors
  1 remote errors, element index: 20
  0 unevaluated and other errors
  first remote error: failed to read data elements

Krista

On Tuesday, February 22, 2022 at 7:04:03 AM UTC-6 giulia.r...@unifi.it wrote:

Gordon Luu

unread,
Feb 25, 2022, 4:15:45 PM2/25/22
to Cardinal MSI Help
I've never encountered the issue so I don't know if it will help, but maybe try moving the data to a directory that isn't associated with OneDrive? I forget what software but I've seen issues where sometimes network directories don't play nicely with code/CLI applications.
Reply all
Reply to author
Forward
0 new messages