So in R I could do something as :
# expression Table contains the expression value (read count, rlog or anything else..)
# percentage is a vector containing the percentage of tumor cells within each sample (its order correspond to the same order as the expression Table columns)
p <- apply(expressionTable,1,function(x){anova(lm(x~percentage))[1,5]})
fdr <- p.adjust(p,"fdr")
# extract significant genes
expressionTableSig <- expressionTable[fdr<=0.05,]
Some question :
- Is it ok to use lm() ? or is there more "powerfull" method to do some regression ?
- Which type of expression data to choose (normalized read count, rlog, vsd, TPM, FPKM, etc...
- the percentage is finite (between 0 and 100). Will the regression not be biased due to the fact that the variable is finite ?
edit: In this paper http://www.nature.com/articles/srep24375 they suggest to use TMM normalization with robust regression ( rlm() function from MASS package ) in order to avoid outlier impact ( as the "classic" lm() function is sensitive to outliers). Any thoughts about that ?
What is your sample size ?
I've ~40 tumor samples (mix of tumor and healthy T-Cells) and ~10 control samples (healthy T-Cells)