CostaLab/scMEGA

problem with SelectTFs

Dalhte opened this issue · 5 comments

Dalhte commented

Hello there
I'm tryingto run ScMega on 10X multiome RNA+ATAC data obtained in Rats tissus. When I run the :
res <- SelectTFs(object = objG,
tf.assay = "chromvar",
rna.assay = "RNA",
atac.assay = "ATAC",
trajectory.name = "Trajectory",
return.heatmap = TRUE,
cor.cutoff = 0.1)
I get
Avis : No layers found matching search pattern provided
Error in GetAssayData():
! No layers are found
Here are the backtrace :
Backtrace:

  1. └─scMEGA::SelectTFs(...)
  2. ├─base::suppressMessages(...)
  3. │ └─base::withCallingHandlers(...)
  4. └─scMEGA::GetTrajectory(...)
  5. ├─SeuratObject::GetAssayData(object, assay = assay, slot = slot)
    
  6. └─SeuratObject:::GetAssayData.Seurat(object, assay = assay, slot = slot)
    
  7.   ├─SeuratObject::GetAssayData(object = object[[assay]], layer = layer)
    
  8.   └─SeuratObject:::GetAssayData.StdAssay(object = object[[assay]], layer = layer)
    
  9.     └─rlang::abort("No layers are found")
    

Can you help me, please ? Is it because I'm working with the rat genome? Or is it something else entirely?
Best
David

Dalhte commented

Hi again
I tried several things randomly:
it seems that "getAssaData" is deprecated in Seurat5 and to be replaced with LayerData, so could my problem come from incompatibility between Seurat5 and ScMega ?
I try to run LayerData for each assay (chromvar, RNA and ATAC), if I run them alone, I got nothing different, if I run for each something like :

objG[['RNA']] <- as(objG[['RNA']], Class = 'Assay5')
LayerData(object = objG[['RNA']])

I have a different error message: no motifs name in this Assay5 object. The problem arises only when I transform the ATAC assay in Assay5, not when I keep a "ChromatinAssay" class, but sadly then I have the "GetAssayData()`:
! No layers are found" again.
Don't know if that help ?

Dalhte commented

If ever it can help someone, here is what I did :
I bypassaded the getassayy using layerdata function:

objG[['SoupXRNA']] <- as(objG[['SoupXRNA']], Class = 'Assay5')
LayerData(object = objG[['SoupXRNA']])

objG[['ATAC']] <- as(objG[['ATAC']], Class = 'ChromatinAssay')
LayerData(object = objG[['ATAC']])

objG[['chromvar']] <- as(objG[['chromvar']], Class = 'ChromatinAssay')
LayerData(object = objG[['chromvar']])

Class = 'ChromatinAssay is necessary to keep the motif names

then I copied the selectTFs function to run if in the rstudio interface directly with some modifications:

  • replace RNA assay with SoupXRNA as I had to run soupX to clean my data
  • and increment the motif names call solution proposed by @AmandaKedaigle in the issue " Motif matching when using mouse data #18 "

and It seems to work fine

Hi @Dalhte

Sorry for my late reply and glad that you found a solution.

Indeed, the Seurat v5 has uplated many APIs, and I need some time to update scMEGA to keep them compatible.

Dalhte commented

Hi @lzj1769
Don't worry, it was nice to find a solution by myself :) Even if the solution is quite tedious :DDD

Best
David

Hello!

Many thanks for the tool,
I am also encountering this same error with the issue seeming to be with GetAssayData() in GetTrajectory. I have had a go at trying to bypass this issue as @Dalhte suggested but this is just creating more errors. Could you please suggest a workaround for this or perhaps a suggestion of which Seurat version is best used with scMEGA? I followed the installation instructions which says devtools::install_github("satijalab/seurat", "seurat5", upgrade='always'), should I try re-running the scMEGA steps but with an older version of seurat? Any suggestions are greatly appreciated, I have managed to follow the steps of the tutorial up to SelectTFs so I'm very keen to get this final bit working to build the GRN!
Eva