GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
382 stars 136 forks source link

scRNA integration with Seurat Object #347

Closed hugokitano closed 3 years ago

hugokitano commented 3 years ago

Hi, I am trying to run addGeneIntegrationMatrix with a Seurat object, and am running into an error. My guess was that the groupRNA parameter should be orig.ident, as is common with most Seurat metadata tables.

> projSaved <- addGeneIntegrationMatrix(
+   ArchRProj = projSaved, 
+   useMatrix = "GeneScoreMatrix",
+   matrixName = "GeneIntegrationMatrix",
+   reducedDims = "IterativeLSI",
+   seRNA = seRNA,
+   addToArrow = FALSE,
+   groupRNA = "orig.ident",
+   nameCell = "predictedCell_Un",
+   nameGroup = "predictedGroup_Un",
+   nameScore = "predictedScore_Un"
+ )
ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-f5ce65aa9a17-Date-2020-10-15_Time-17-27-45.log
If there is an issue, please report to github with logFile!
2020-10-15 17:27:46 : Running Seurat's Integration Stuart* et al 2019, 0.007 mins elapsed.
2020-10-15 17:27:46 : Checking ATAC Input, 0.01 mins elapsed.
2020-10-15 17:27:46 : Checking RNA Input, 0.01 mins elapsed.
Error in `$<-`(`*tmp*`, Group, value = paste0(seRNA@meta.data[, groupRNA])) : 
  no method for assigning subsets of this S4 class

However, typing seRNA@meta.data[,"orig.ident"] into the console does correctly extract the column. Any ideas?

ArchR-addGeneIntegrationMatrix-f5ce65aa9a17-Date-2020-10-15_Time-17-27-45.log

jgranja24 commented 3 years ago

Can you try

seRNA$Group <- paste0(seRNA@meta.data[,"orig.ident"])

I actually think this is a Seurat version error. From the logs your version is Seurat_2.3.4 you need at least Seurat v3 for integration analyses. I need to add an explicit check for this.

Hope that helps!

Jeff

hugokitano commented 3 years ago

Ah thanks!

DaianeH commented 1 year ago

Hi,

I'm getting a similar error:

ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-86317497d8e-Date-2023-03-08_Time-15-34-38.748873.log If there is an issue, please report to github with logFile! 2023-03-08 15:34:39.091829 : Running Seurat's Integration Stuart* et al 2019, 0.006 mins elapsed. 2023-03-08 15:34:41.610971 : Checking ATAC Input, 0.048 mins elapsed. 2023-03-08 15:34:52.873916 : Checking RNA Input, 0.235 mins elapsed. Error in addGeneIntegrationMatrix(ArchRProj = sc_atac_int, useMatrix = "GeneScoreMatrix", : groupRNA not in meta.data of Seurat Object

I already tried a similar solution suggested by @jgranja24 with: sc_rna$groupRNA <- paste0(sc_rna@meta.data[,"orig.ident"])

But that did not work. Any suggestions?

Thank you in advance,

rcorces commented 1 year ago

@DaianeH - It seems like there is a problem with how you are using this function. The error tells you that the value that you passed to the groupRNA param does not exist as a column in your seRNA@meta.data. you did not upload your log file so I cannot help further.

DaianeH commented 1 year ago

Sorry, indeed I forgot to attach the log in the comment above. Sending it now. Do I understand correctly that the groupRNA column is the column with sample names - that need to match the sample names in the scATAC-seq data?

ArchR-addGeneIntegrationMatrix-f9635eb3f2d9-Date-2023-03-09_Time-20-03-04.log

rcorces commented 1 year ago

@DaianeH - No that is not correct. I would recommend examining the tutorial code and dataset closely to understand these parameters