Error in SummarizedExperiment(...)
1
0
Entering edit mode
MxT • 0
@e005c172
Last seen 19 months ago
Australia

Hello, I am using StandR to analyze my GeoMx data. I load my data by running:

library(standR)
library(SpatialExperiment)
library(limma)
library(ExperimentHub)
library(ggplot2)

library(tidyverse)

countFile <- read_tsv("TargetCount.txt") %>% as.data.frame()
sampleAnnoFile <- read_tsv("SampleAnno.txt") %>% as.data.frame()
featureAnnoFile <- read_tsv("featureAnno.txt") %>% as.data.frame()
# include your problematic code here with any corresponding output 
# please also include the results of running the following in an R session 

sessionInfo( )

Then I import the data into a spatial experiment object by running:

spe <- readGeoMx(countFile, sampleAnnoFile, featureAnnoFile)

But I got this error:

Error in SummarizedExperiment(...) : 
  the rownames and colnames of the supplied assay(s) must be NULL or identical to those of the SummarizedExperiment object
  (or derivative) to construct

I would be very appreciated it if someone could give me an idea of what may have gone wrong. Many thanks!

SummarizedExperiment StandR • 1.1k views
ADD COMMENT
0
Entering edit mode
helucro ▴ 70
@crowellh-11823
Last seen 5 months ago
University of Zurich, Switzerland

This points to a mismatch between

  1. the rownames of countFile and rownames of featureAnnoFile (row metadata) and/or
  2. the colnames of countFile and rownames of sampleAnnoFile (column metadata)

As the error suggest, one of them needs to be NULL (e.g., when the counts don't have row/colnames, the rownames of the corresponding metadata are used), or both need to match.

Here's an example...

# mock matrix with column names only
cs <- letters[1:20]
y <- matrix(0, 10, length(cs),
    dimnames = list(NULL, cs))

# assay colnames and colData rownames match
cd <- data.frame(x = seq_along(cs), row.names = cs)
SummarizedExperiment(list(y), colData = cd) # valid

# rownames missing from colData, assay colnames are used
cd <- data.frame(x = seq_along(cs), row.names = NULL)
SummarizedExperiment(list(y), colData = cd) # valid

# mismatch gives error
cd <- data.frame(x = seq_along(cs), row.names = sample(cs))
SummarizedExperiment(list(y), colData = cd) # error!
> Error in SummarizedExperiment(list(y), colData = cd) : 
  the colnames of the supplied assay(s) must be NULL
  or identical to those of the SummarizedExperiment
  object (or derivative) to construct
ADD COMMENT

Login before adding your answer.

Traffic: 661 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6