Giter Site home page Giter Site logo

Comments (4)

ncborcherding avatar ncborcherding commented on August 21, 2024

Hey SimoniMD,

This is a good suggestion and actually the way I generally summarise my enrichment results - I will add it to the to do list and have it released in the next version.

In the interim, a method for this using tidyr would be:

seuratObj <- addMetaData(seuratObj, ES)
seurat.meta <- [email protected]
summary <- seurat.meta %>%
                            group_by(variable) %>%
                            summarise(across(colnames(ES), median))
#You can make this ggplot friendly with
summary.melt <- reshape2::melt(summary)

Thanks,
Nick

from escape.

Dragonmasterx87 avatar Dragonmasterx87 commented on August 21, 2024

Hi @ncborcherding ,

Sorry for the stupid question, but I havent gotten this to work.
If I have a seurat object called data and an erichIT obj called ES where I have performed the following:

seurat.meta <- data$meta.data
summary <- seurat.meta %>%
  group_by("celltype") %>% #celltype being the slot of metadata I would want to create averages for
  summarise(across(colnames(ES), median))
summary.melt <- reshape2::melt(summary)

The output doesnt make sense, its just some median value of all cells, not seggregated data based on a meta data slot i.e. celltype. If we dont do this somehow we wont be able to plot an average heatmap of certain strings of GO types..... any suggestions?

The goal is to make a heatmap possibly using ditto similar to what we do natively for all cells, but showing averages instead of all cell values.

Cheers and thanks again!
🐲

from escape.

Dragonmasterx87 avatar Dragonmasterx87 commented on August 21, 2024

For now this is what im doing....would be gerat to have the heatmap function work as well!!!

image

from escape.

ncborcherding avatar ncborcherding commented on August 21, 2024

Hey @Dragonmasterx87

I think you might have an error in your tidy grammar - instead of "celltype", it should be celltype with no quotes. With quotes, it ends up summarizing across all cells instead of looking for a variable.

So it should read like this:

seurat.meta <- data$meta.data
summary <- seurat.meta %>%
  group_by(celltype) %>% #here is the change
  summarise(across(colnames(ES), median))
summary.melt <- reshape2::melt(summary)

Hope that helps,
Nick

from escape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.