calculating median expression between to identical gene names in data frame
1
0
Entering edit mode
@srinivas-iyyer-939
Last seen 9.6 years ago
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
Clustering Cancer affy Clustering Cancer affy • 1.3k views
ADD COMMENT
0
Entering edit mode
@adaikalavan-ramasamy-675
Last seen 9.6 years ago
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 > > >
ADD COMMENT

Login before adding your answer.

Traffic: 903 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6