Skip to content

Generate a fraction of immune cell between two condition from single cell RNAseq #7806

Answered by Zig-E-Stardust
synatkeamsk asked this question in Q&A
Discussion options

You must be logged in to vote

You can try the following code (make sure to have Seurat loaded, as well as to have the following packages "foreach" and "openxlsx" installed; in addition, change the names where needed - e.g., if your main object is not called "combined", replace "combined" with whatever name you gave that object) - tell me if it worked for you:

library(foreach)
combined$annotation_mouse <- paste(combined$annotation, combined$mouse, sep = "_")
combined$annotation_group <- paste(combined$annotation, combined$group, sep = "_")

Idents(combined) <- "annotation"
levels(combined)

# create a vector of cluster names
clusters <- levels(combined)

# create an empty vector to store the results
PCT <- vector()

# …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by synatkeamsk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants