>計算cluster細胞數(shù)目
library(ggsci)
cell_stat_df <- table(sce_all.intergrated@meta.data$celltype, sce_all.intergrated@meta.data$orig.ident) %>%
reshape2::melt()
colnames(cell_stat_df) <- c("ClusterName","Sample","Count")
cell_stat_df$ClusterName <- factor(cell_stat_df$ClusterName)
Colors = pal_igv("default")(51)
ggplot(data = cell_stat_df, aes(x = Count, y = Sample, fill = ClusterName)) +
geom_bar(stat = "identity", width=0.8, position="fill")+
scale_fill_manual(values = Colors_vector[1:15]) +
theme_bw()+
theme(panel.grid =element_blank()) +
labs(x="Ratio",y="")+
theme(axis.text.y = element_text(size=12, colour = "black"))+
theme(axis.text.x = element_text(size=12, colour = "black"))+
theme(axis.text.x.bottom = element_text(hjust = 1, vjust = 1, angle = 45))
>計算cluster細胞比率
cell_ratio_df <- prop.table(table(Idents(sce_all.intergrated), sce_all.intergrated$orig.ident), margin = 2)
cell_ratio_df <- cell_ratio_df %>% as.data.frame()
cell_ratio_df $Var1 <- as.integer(cell_ratio_df $Var1)
cell_ratio_df <- cell_ratio_df %>% left_join(celltype, by = c("Var1"="ClusterID"))
Colors = pal_igv("default")(51)
ggplot(data = cell_ratio_df , aes(x =Var2, y = Freq, fill = celltype)) +
geom_bar(stat = "identity", width=0.8, position="fill")+
scale_fill_manual(values = Colors[1:15]) +
theme_bw()+
theme(panel.grid =element_blank()) +
labs(x="",y="Ratio")+
theme(axis.text.y = element_text(size=12, colour = "black"))+
theme(axis.text.x = element_text(size=12, colour = "black"))+
theme(axis.text.x.bottom = element_text(hjust = 1, vjust = 1, angle = 45))
細胞數(shù)據(jù)統(tǒng)計
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
- 文/潘曉璐 我一進店門乏梁,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人关贵,你說我怎么就攤上這事遇骑。” “怎么了揖曾?”我有些...
- 文/不壞的土叔 我叫張陵落萎,是天一觀的道長。 經(jīng)常有香客問我翩肌,道長模暗,這世上最難降的妖魔是什么? 我笑而不...
- 正文 為了忘掉前任念祭,我火速辦了婚禮兑宇,結果婚禮上,老公的妹妹穿的比我還像新娘粱坤。我一直安慰自己隶糕,他們只是感情好瓷产,可當我...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著枚驻,像睡著了一般濒旦。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上再登,一...
- 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼绵估!你這毒婦竟也來了炎疆?” 一聲冷哼從身側響起,我...
- 正文 年R本政府宣布挽放,位于F島的核電站,受9級特大地震影響蔓纠,放射性物質發(fā)生泄漏辑畦。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒙蒙 一腿倚、第九天 我趴在偏房一處隱蔽的房頂上張望纯出。 院中可真熱鬧,春花似錦、人聲如沸暂筝。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽焕襟。三九已至陨收,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間鸵赖,已是汗流浹背务漩。 一陣腳步聲響...
推薦閱讀更多精彩內容
- 前情回顧:Gephi網(wǎng)絡圖極簡教程[http://www.reibang.com/p/86145943695a]...
- A.使用量統(tǒng)計: 我們會針對產(chǎn)品用戶做出一套數(shù)據(jù)分析系統(tǒng)包吝,用于監(jiān)測用戶在產(chǎn)品場當中所觸發(fā)的行為,亦可以用現(xiàn)成的數(shù)據(jù)...
- 以下是一些簡單的步驟來創(chuàng)建數(shù)據(jù)透視表: 需要新建一列數(shù)量B列,填充數(shù)字1息堂,用于做求和用嚷狞,選擇您要進行分析的數(shù)據(jù)范圍...
- 今天要吹爆的這個工具是來自華南理工大學的科研團隊開發(fā)的IOAT:一種用于組學數(shù)據(jù)和臨床數(shù)據(jù)統(tǒng)計分析的交互式工具床未。它...
- 最近一直在研究數(shù)據(jù)分析的相關知識,把自己學到的會一點一點分享出來振坚,先從百度統(tǒng)計說起薇搁。 數(shù)據(jù)統(tǒng)計工具:百度統(tǒng)計 百度...