scMEGA icon indicating copy to clipboard operation
scMEGA copied to clipboard

problem with SelectTFs

Open Dalhte opened this issue 2 years ago • 5 comments

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 avatar Jul 26 '23 12:07 Dalhte

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 avatar Jul 26 '23 14:07 Dalhte

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

Dalhte avatar Jul 28 '23 08:07 Dalhte

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.

lzj1769 avatar Jul 28 '23 18:07 lzj1769

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

Best David

Dalhte avatar Jul 29 '23 09:07 Dalhte

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

evaham1 avatar Sep 02 '23 15:09 evaham1