We have 35 mesenchyaml stem cells (MSCs) single-cell RNA-Seq data, and would like to compare gene expression heterogeneity between different culture conditions (i.e. hypoxia and normoxia). In other words, We would like to identify genes that are more homogeneous in hypoxia than in normoxia.
I know how to run leveneTest using the car package on R for single gene (please see two examples below). However, I don’t know how to run leveneTest for all 5,834 genes at the same time. Could you help me, and please see our data from: http://68.181.92.180/~Gary/temporal/Log2_Transpose_CPM_MSC35Sample_CPM5Sample10_5834Gene.txt
More importantly, how to transform all 5,834 leveneTest results to a table with two columns? The first column is the gene symbol, and the second column is the P-value. Many thanks.
setwd("/Volumes/TOSHIBA EXT/20170305_LeveneTest/car")
require(car)
msc <- read.table("Log2_Transpose_CPM_MSC35Sample_CPM5Sample10_5834Gene.txt", header = T)
Test:
leveneTest(CEBPB ~ Culture, data = msc, center=median)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 6.5486 0.01527 *
33
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
And:
leveneTest(PLIN2 ~ Culture, data = msc, center=median)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 0.1804 0.6738
33