[BioC] calculating median expression between to identical gene names in data frame

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Sat Mar 15 03:41:54 CET 2008


I am assuming that you want to "average" the gene profiles.

See if this works:

    colMedians <- function(mat) apply(mat, 2, median)

    sapply( split( df, gids ), colMedians )

This is computationally inefficient as the number of rows increase but 
this should be reasonably fast for 180 rows.

Regards, Adai



Srinivas Iyyer wrote:
> Dear group, 
> I have a data frame with 180 rows and 25 coloumns
> (data from a affy experiment).  I have 10 normals and
> 15 cancer lines. 
> 
> of 180 I have some duplicate gene names (arising from
> two different probesets for a single gene). 
> 
> I want to calculate the median expression value for
> these two identical genes. 
> 
> here I have 6 samples and 2 genes.
> gids      N1	N2	N3	T1	T2	T3	T4
> G1	10	12	11	40	46	39	46
> G1	8	10	8	35	46	32	53
> 
> could any one please help me How can I calculate the
> median expression for these two identical genes.
> After I do this, I want to do clustering. 
> 
> thank you.
> 
> srini
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
> 
> 
>



More information about the Bioconductor mailing list