Could not view/find meta.data and Error merging three seurat object
1
0
Entering edit mode
15 months ago
synat.keam ▴ 100

Dear Fellow,

I created three seurat object and attempted to merge them using the following codes

NML_I<- CreateAssayObject(counts= NML_I, project= "NML_I", min.cells = 3, min.features = 200)
NML_II<- CreateAssayObject(counts= NML_II, project= "NML_II", min.cells = 3, min.features = 200)
NML_III<- CreateAssayObject(counts= NML_III, project= "NML_III", min.cells = 3, min.features = 200)

1. Once I tried to view the metadata using the following command

View(NML_I@meta.data)

I got error saying

Error in is.data.frame(x) : 
  no slot of name "meta.data" for this object of class "Assay"

It worked in someone's video tutorial on youtube, but not work in my practice.

2. Once I attempted to merge the three objects, I got the following errors

MergedNML <- merge(NML_I, y = c(NML_II, NML_III),
                   add.cell.ids = ls()[1:3],
                   project = 'MergedNML')

Warning: The following arguments are not used: project
Error in fixupDN.if.valid(value, x@Dim) : 
  length of Dimnames[[2]] (1) is not equal to Dim[2] (3669)

I tried another code

MergedNML <- merge(NML_I, y = list(NML_II, NML_III),
                   add.cell.ids = ("1", "2", "3"),
                   project = 'MergedNML')

I still get error

Warning: The following arguments are not used: project
Error in fixupDN.if.valid(value, x@Dim) : 
  length of Dimnames[[2]] (1) is not equal to Dim[2] (3669)

Understand I should ask in seurat forum, but I believe some experts here may have some thought of why I got error. appreciate all your help.

Regards,
Synat

Seurat single-cell • 1.4k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. If your code has long lines with a single command, break those lines into multiple lines with proper escape sequences so they're easier to read and still run when copy-pasted. I've done it for you this time.
code_formatting

You used the quote option (the button with the double quotes symbol on it). That option is for quoting a source verbatim, not formatting code as used with/in a program.

ADD REPLY
3
Entering edit mode
15 months ago
bk11 ★ 3.0k

Please use CreateSeuratObject instead of CreateAssayObject

NML_I<- CreateSeuratObject(counts= NML_I, project= "NML_I", min.cells = 3, min.features = 200)
...and the same for the rest
ADD COMMENT

Login before adding your answer.

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