Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AverageHeatmap() function in Seurat v5 #43

Open
ziyuan-ma opened this issue May 10, 2024 · 3 comments
Open

AverageHeatmap() function in Seurat v5 #43

ziyuan-ma opened this issue May 10, 2024 · 3 comments

Comments

@ziyuan-ma
Copy link

ziyuan-ma commented May 10, 2024

Hello, thanks for developing this wonderful visualization package! I have encountered some issues passing the Seurat v5 object to AverageHeatmap() function. Could you please advise how should I pull data from the data layer instead of from slot? Thank you!

> AverageHeatmap(object = pbmc,
+                markerGene = markers$gene)
As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
This message is displayed once per session.
Warning: No layers found matching search pattern provided
[1] "Your cluster annotation color is:" "#B969E5FF"                         "#BD94EDFF"                        
[4] "#E6C0FBFF"                         "#E477F5FF"                         "#FFC8CEFF"                        
[7] "#B8FD8AFF"                         "#7CF8E1FF"                        
Warning message:
The `slot` argument of `AverageExpression()` is deprecated as of Seurat 5.0.0.
ℹ Please use the `layer` argument instead.
ℹ The deprecated feature was likely used in the Seurat package.
  Please report the issue at <https://github.com/satijalab/seurat/issues>.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 
@pacmandoh
Copy link
Contributor

hi @ziyuan-ma , A new layer has been added to Seurat V5, and the slot slot used to extract gene expression data in previous versions seems to no longer work in V5. The old version of slot is used in the author's parameters and does not apply to V5. If the author doesn't have time to follow up, I will submit a PR to fix this problem. If this warning ⚠️ does not affect your results, you don't have to care. If there is an impact, you can copy the source code and put it in:

  # get cells mean gene expression
  mean_gene_exp <- as.matrix(
    data.frame(
      Seurat::AverageExpression(object,
        features = markerGene,
        group.by = group.by,
        assays = assays,
        slot = slot
      )
    )
  )

Modify to:

  # get cells mean gene expression
  mean_gene_exp <- as.matrix(
    data.frame(
      Seurat::AverageExpression(object,
        features = markerGene,
        group.by = group.by,
        assays = assays,
        layer = "yourSeuratObjLayerName" || "data"
      )
    )
  )

@junjunlab
Copy link
Owner

Thanks, I will fix this.

@junjunlab
Copy link
Owner

Now you can re-install scRNAtoolVis and try averageHeatmap on Seruat V5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants