Question: merge two SeuratObjects to do the integration
0
gravatar for yueli7
4 months ago by
yueli7190
China
yueli7190 wrote:

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 • 524 views
ADD COMMENTlink modified 4 months ago • written 4 months ago by yueli7190

What are these h1.rds and h2.rds

ADD REPLYlink written 4 months ago by geek_y11k

Hello geek_y,

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

Thank you again!

Best,

Yue

ADD REPLYlink written 4 months ago by yueli7190
1

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 REPLYlink written 4 months ago by geek_y11k

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

ADD REPLYlink written 4 months ago by yueli7190

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

ADD REPLYlink written 3 months ago by 29628730040

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 REPLYlink written 3 months ago by yueli7190

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 REPLYlink written 4 months ago by Bastien Hervé4.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1440 users visited in the last hour