I want to transform a TCGA mRNA expression matrix (in linear data format) to log2-ratios and then run a feature (gene) selection, selecting the 1000 most variant genes (genes with higher standard deviation across samples). The workflow is the following:

  1. Select "good" genes before log2 ratio (genes each with median signal at least t in p% of samples);
  2. On selected genes, run log2 ratio, dividing each gene by its median signal and then log2-transforming the result matrix;
  3. Select the 1000 most variant genes along all samples.

How do I select t and p?

  • $\begingroup$ Cross posted on biostars: biostars.org/p/132301 $\endgroup$
    – Devon Ryan
    Feb 24, 2015 at 15:15
  • 2
    $\begingroup$ @DevonRyan biostars is not part of the SE network. It is only cross-posting when posted on different Stack Exchange sites. We can hardly expect people not to poest anywhere else on the internet if they want to post here! We just want to avoid duplicating information across the SE network. $\endgroup$
    – terdon
    Mar 2, 2015 at 17:57

1 Answer 1


There is no rule for fixing t and p. It depends on the level of stringency you expect. Value of t depends on what is considered to be an active concentration; this need not be same for all genes.

This is an RNAseq data; I don't understand what is the "median" signal you are talking about. For each sample a gene would have a normalized expression value which is typically RPKM (Reads Per Kilobase per Million mapped reads). If you have replicates for each sample then take the mean not the median.

Regarding calculation of log-ratios: Always be careful with this especially in case of zeros. Instead of log ratios you may use some sort of a gain metric:

ratio = x/y 
gain = (x-y)/y

You can also do a principal component analysis on the data and select first n principal components.

  • $\begingroup$ Ok for the "median", it was a mistake. I did not understand: "Always be careful with this especially in case of zeros" - what did you mean? Thanks $\endgroup$
    – gc5
    Mar 8, 2015 at 14:24
  • $\begingroup$ In case of expression is zero in one sample then log transformation will give you NaN (undefined) $\endgroup$
    Mar 8, 2015 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .