Git Product home page Git Product logo

Comments (8)

sqjin avatar sqjin commented on August 26, 2024

Hi @natalkon , I just updated the package to support such action. You can re-label cells without re-doing computeCommunProb

from cellchat.

ilcink avatar ilcink commented on August 26, 2024

Dear @sqjin ,

I tried to update the package simply by
devtools::install_github("sqjin/CellChat")

But I got
Error: Failed to install 'CellChat' from GitHub:
(converted from warning) installation of package ‘backports’ had non-zero exit status

How can I overcome it?

Thanks!

from cellchat.

ilcink avatar ilcink commented on August 26, 2024

Dear @sqjin ,
I have manually deleted the "backports" folder from the library, downloaded the package "backports_1.1.9.zip" from CRAN https://cran.r-project.org/web/packages/backports/index.html and placed the new "backports" into the library.
After that updating the package with
devtools::install_github("sqjin/NMF")
devtools::install_github("sqjin/CellChat")
was no problem.

But after
identity = data.frame(group = sc_data$cell_type, row.names = names(sc_data$cell_type)) # create a dataframe consisting of the cell labels
unique(identity$group)
cellchat <- addMeta(cellchat, meta = identity, meta.name = "cell_type")
cellchat <- setIdent(cellchat, ident.use = "cell_type") # set "cell_type" as default cell identity
levels(cellchat@idents)
groupSize <- as.numeric(table(cellchat@idents))

Re-labelling worked for
CellChat::netVisual_aggregate(cellchat, signaling = c("TGFb"), layout = "circle", vertex.size = groupSize)

but still did not happen in
CellChat::netAnalysis_river(cellchat, pattern = "outgoing")
or in
CellChat::netAnalysis_dot(cellchat, pattern = "outgoing")

Do you know what could be the reason for that?

Thanks!

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

@natalkon As I mentioned that "You can re-label cells without re-doing computeCommunProb", thus you need to re-run all the functions after computeCommunProb.

from cellchat.

ilcink avatar ilcink commented on August 26, 2024

@sqjin That is amazing! Thank you!!!

from cellchat.

ruohuchengxhe avatar ruohuchengxhe commented on August 26, 2024

@sqjin
Hi, I tried to change one label in both the metadata and idents:

levels(cellchat@meta$labels)[levels(cellchat@meta$labels) =='Mast cells' ] <- 'Mc 4'
levels(cellchat@idents)[levels(cellchat@idents) =='Mast cells' ] <- 'Mc 4'
table(cellchat@idents)

The label was changed successfuly.

And then I run the code after computeCommunProb, but when I try to plot, the label is still 'Mast cells', even for the CellChat::netVisual_aggregate function.

Could you please give advice?
Thanks!

from cellchat.

sqjin avatar sqjin commented on August 26, 2024

Hi @ruohuchengxhe , you should do it levels(cellchat@meta$labels)[levels(cellchat@meta$labels) =='Mast cells' ] <- 'Mc 4' cellchat <- setIdent(cellchat, ident.use = "cell_type") # set "cell_type" as default cell identity

from cellchat.

ruohuchengxhe avatar ruohuchengxhe commented on August 26, 2024

Hi @ruohuchengxhe , you should do it levels(cellchat@meta$labels)[levels(cellchat@meta$labels) =='Mast cells' ] <- 'Mc 4' cellchat <- setIdent(cellchat, ident.use = "cell_type") # set "cell_type" as default cell identity

Sure! Didn't do this. Thanks!

from cellchat.

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.