I have number of cells in three cell types T, B, M in a Seurat object
For two groups of patients, cancers and controls like
> table(Idents(pbmc), pbmc$samples)
PN0252_0001 PN0252_0002 PN0252_0003 PN0252_0004 PN0252_0005 PN0252_0006 PN0252_0008
T 3550 568 136 268 1835 2 1678
B 136 129 11 25 133 0 203
M 120 22 18 26 159 0 59
> dput(table(Idents(pbmc), pbmc$samples))
structure(c(3550L, 136L, 120L, 568L, 129L, 22L, 136L, 11L, 18L,
268L, 25L, 26L, 1835L, 133L, 159L, 2L, 0L, 0L, 1678L, 203L, 59L
), .Dim = c(3L, 7L), .Dimnames = structure(list(c("T", "B", "M"
), c("PN0252_0001", "PN0252_0002", "PN0252_0003", "PN0252_0004",
"PN0252_0005", "PN0252_0006", "PN0252_0008")), .Names = c("",
"")), class = "table")
>
Patients PN0252_0001
, PN0252_0002
, PN0252_0003
, PN0252_0004
are controls
and PN0252_0005
, PN0252_0006
, PN0252_0008
are cancers
I want to look at the difference of the proportion of cells in each cell type between cancer and control
But I am confused for getting proportion should I divide the number of cells on total cells in the object or total cells in each group
Basically I need a box plot like although here numbers are not correct