Error in validObject(.Object) : invalid class "CompressedGRangesList" object
1
0
Entering edit mode
yaozhan88 • 0
@yaozhan88-22185
Last seen 4.5 years ago

Hi, I am trying to subset the sce object, by selecting specific row names. My code is as follow:

sce = SingleCellExperiment(assays = list(counts = as.matrix(count)), colData = colData, rowData = metaData)
select_name = rownames(sce)[300:400]
sce_select = sce[select_name, ]

The console returned error:

Error in validObject(.Object) : 
  invalid class "CompressedGRangesList" object: 
    'mcols(x)' cannot have columns named "seqnames", "ranges", "strand", "start",
    "end", "width", or "element"

Coule you please help to fix the issue?

Thank you!

software error • 1.6k views
ADD COMMENT
0
Entering edit mode

Please provide a reproducible example and your sessionInfo().

It looks like somewhere in your sce object there is a CompressedGRangesList object that is considered invalid because it has metadata columns that use "forbidden" names.

This restriction on the metadata column names of GRanges and GRangeList derivatives was introduced a long time ago by one of the original creators of these classes. I never really understood the reason for this restriction and always found it arbitrary. However I've kept it for all these years because it has never caused trouble in practice. But maybe it's time to get rid of it.

H.

ADD REPLY
0
Entering edit mode
@d9b8998c
Last seen 2.0 years ago
Hong Kong

The rowData of sce (rowData(sce) ) could not include the colnames called "seqnames", "ranges", "strand", "start", "end", "width", or "element". You just need to change these colnames or deleted them and this issue can be solve.

ADD COMMENT

Login before adding your answer.

Traffic: 741 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