merge two SeuratObjects to do the integration
0
0
Entering edit mode
4.3 years ago
yueli7 ▴ 250

Hello,

I want to merge two SeuratObjects: h1 and h2, and do the integration.

https://satijalab.org/seurat/pancreas_integration_label_transfer.html

Thank you in advance for great help!

Best,

Yue

> a<-"hc_51_02.csv"
> a1<-data.frame(fread(a),check.names=FALSE, row.names=1)
|--------------------------------------------------|
|==================================================|
> h1<- CreateSeuratObject(counts = a1, project = "h1", min.cells = 3, min.features = 200)
> a<-"hc_52_02.csv"
> a1<-data.frame(fread(a),check.names=FALSE, row.names=1)
> h2<- CreateSeuratObject(counts = a1, project = "h2", min.cells = 3, min.features = 200)

> h1<-readRDS(file="h1.rds")
> h2<-readRDS(file="h2.rds")
> h12<-merge(h1,h2)
Warning message:
In CheckDuplicateCellNames(object.list = objects) :
Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
> pancreas <- CreateSeuratObject(h12, meta.data = meta.data02)
Error in as.vector(data) : 
no method for coercing this S4 class to a vector
In addition: Warning message:
In CreateSeuratObject(h12, meta.data = meta.data02) :
Some cells in meta.data not present in provided counts matrix.
RNA-Seq • 9.4k views
ADD COMMENT
0
Entering edit mode

What are these h1.rds and h2.rds

ADD REPLY
0
Entering edit mode

Hello geek_y,

Thank you so much for your response! h1, and h2 are two SeuratObjects.

Thank you again!

Best,

Yue

ADD REPLY
1
Entering edit mode

If you are merging two seurat objects by merge function from Seurat, the resulting object is a Seurat object. So you dont need to create one. I am not sure what you are trying to do. The link you attached is about data integration and here you are merging.

ADD REPLY
0
Entering edit mode

Hello geek_y, Thank you so much for your great help! Best, Yue

ADD REPLY
0
Entering edit mode

The following warning also appeared when I was doing the data merge。What's going on here? How to solve it?

ADD REPLY
0
Entering edit mode

Hello 2962873004,

Warning is not serious.

Only can create one Seurat object: h1 is already one seurat object, it can not be created twice, so it comes out error.

Best,

Yue

ADD REPLY
0
Entering edit mode

I don't really know what you are trying to do writting over on your h1 and h2 variables after creating your seurat objects but you have a merge function in seurat :

pbmc.combined <- MergeSeurat(object1 = pbmc4k, object2 = pbmc8k, add.cell.id1 = "4K", 
add.cell.id2 = "8K", project = "PBMC12K")

https://satijalab.org/seurat/v2.4/merge_vignette.html

ADD REPLY

Login before adding your answer.

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