coerce matrix to aafTable
1
0
Entering edit mode
Georg Otto ▴ 510
@georg-otto-956
Last seen 10.3 years ago
Hi, I have an R/bioconductor problem, that seemed to be quite simple to me at the first glance, but turned out to be tricky, either because I do not have reached the necessary level of R-savvyness yet, or because I miss something obvious. Here is the problem: I want to transform a matrix of expression values (where rows are genes and columns are hybridizations) into an aafTable (from package annaffy). The probe IDs should be taken from the row names of the matrix and the column names should be taken from the column names of the matrix. No problem to do this by hand: table<-aafTable(probeids=rownames(matrix), "colname1"=matrix[,1], "colname2"=matrix[,2], "colname3"=matrix[,3], "colname4"=matrix[,4]) I would like to do that programatically for many different matrices which differ both in the number of columns and in the column names, maybe by using a small function. However I was not successful to contrive such a thing. Maybe somebody out there could give me a hint? Best, Georg
probe probe • 734 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States
Hi Georg, Georg Otto wrote: > Hi, > > I have an R/bioconductor problem, that seemed to be quite simple to me > at the first glance, but turned out to be tricky, either because I do > not have reached the necessary level of R-savvyness yet, or because I > miss something obvious. > > Here is the problem: I want to transform a matrix of expression > values (where rows are genes and columns are hybridizations) into an > aafTable (from package annaffy). The probe IDs should be taken from > the row names of the matrix and the column names should be taken from > the column names of the matrix. No problem to do this by hand: > > table<-aafTable(probeids=rownames(matrix), > "colname1"=matrix[,1], > "colname2"=matrix[,2], > "colname3"=matrix[,3], > "colname4"=matrix[,4]) table <- aafTable(items = as.data.frame(matrix)) This can be rather computationally expensive if the matrices are large, but it is probably the simplest solution. Best, Jim > > I would like to do that programatically for many different matrices > which differ both in the number of columns and in the column names, > maybe by using a small function. However I was not successful to > contrive such a thing. Maybe somebody out there could give me a hint? > > Best, > > Georg > > _______________________________________________ > 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 -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD COMMENT

Login before adding your answer.

Traffic: 477 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