cannot create MSImagingExperiment()

18 views
Skip to first unread message

Davide G. Franchina

unread,
Feb 19, 2024, 9:22:52 PMFeb 19
to Cardinal MSI Help
Hi all,

I am trying to create an MSImagingExperiment from scratch but I get this error:

object <- MSImagingExperiment(
  imageData = imagedata,
  featureData = MassDataFrame(as.numeric(featuredata$mass)),
  pixelData = PositionDataFrame(run = factor(sample),
                                coord = coord_data))

Error in validObject(.Object) :
  invalid class “MSImagingExperiment” object: 1: number of rows in 'featureData' must match number of rows in 'imageData'
invalid class “MSImagingExperiment” object: 2: number of rows in 'pixelData' must match number of columns in 'imageData'


here is the data:
> imagedata
SimpleImageArrayList of length 10
 names(10):        894       929 ...      1289      1309
 class(10):        matrix        matrix ...        matrix        matrix
   dim(10): <975 x 275> <975 x 275> ... <975 x 275> <975 x 275>
   mem(10):     9.35 MB     9.35 MB ...     9.35 MB     9.35 MB

> head(MassDataFrame(as.numeric(featuredata$mass)))
MassDataFrame with 6 rows and 0 columns
       :mz:
  <numeric>
1   894
2   929
3  1044
4  1095
5  1116
6  1136

> head(PositionDataFrame(run = factor(sample),
+                        coord = coord_data))
PositionDataFrame with 6 rows and 0 columns
  :run:   coord:x   coord:y
<factor> <integer> <integer>
1 test         1         1
2 test         2         1
3 test         3         1
4 test         4         1
5 test         5         1
6 test         6         1

any hint would be appreciated, thanks!
Reply all
Reply to author
Forward
0 new messages