medain global normalize - argument matrix
1
1
Entering edit mode
@james-w-macdonald-5106
Last seen 12 hours ago
United States
Hi Mark, On 10/27/2012 5:13 PM, Mark B wrote: > Hi, > I am trying to normalize a matrix of logged (base 2) cDNA expression > intensity values (dimensions 4000, 4) from only the Cy5 channel derrived > from an marrayraw object. I would like to normalize the values > using global median normalization where all arrays result having the same > median value. I would also like a matrix returned from the function. > > I have found how to use this normalize using an marrayraw object as > argument ( e.g. maNorm(m, norm="median") ) but > I can't seem to find how to do this with a matrix as argument. > > I have also tried the following but while my argument is a matrix my output > is a numeric vector that I can't seem to coerce > back into a matrix with the same dimensions I started with. > > > # median normalize all samples (columns) > > s.median<- apply(s, 2, median) > > class(s.median) > > [1] "numeric" Right. You calculated the median for each column of your matrix, which is what the apply() function is for (e.g., you apply a function over the margins of a matrix - the columns in your case). So what you really want here is the sweep() function, which is admittedly a bit cryptic (at least it was for me at one time). Anyway, the idea is that you will remove (sweep) a summary statistic over the margins of a matrix, based on a function you supply. The default is to subtract, which happens to be what you want to do. norm.mat <- sweep(s, 2, s.median) As an aside, single letter object names are fine for just playing around with data, but I would caution against using them for 'real' code. IMO it is advantageous to use a descriptive name for objects, so when you are looking back at your code in the future you don't have to go step by step to figure out what a and b and c and d and f are. Best, Jim > > > > Any hints? > > > > Thanks in advance, > > MAB > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > 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 University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
Normalization GO Normalization GO • 1.8k views
ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 12 minutes ago
WEHI, Melbourne, Australia
Dear MAB, normalizeMedianValues() in the limma package does exactly this. Best wishes Gordon ------------ original message ---------------------- [BioC] medain global normalize - argument matrix Mark B mablfm at gmail.com Sat Oct 27 23:13:51 CEST 2012 Hi, I am trying to normalize a matrix of logged (base 2) cDNA expression intensity values (dimensions 4000, 4) from only the Cy5 channel derived from an marrayraw object. I would like to normalize the values using global median normalization where all arrays result having the same median value. I would also like a matrix returned from the function. I have found how to use this normalize using an marrayraw object as argument ( e.g. maNorm(m, norm="median") ) but I can't seem to find how to do this with a matrix as argument. I have also tried the following but while my argument is a matrix my output is a numeric vector that I can't seem to coerce back into a matrix with the same dimensions I started with. # median normalize all samples (columns) s.median <- apply(s, 2, median) class(s.median) [1] "numeric" Any hints? Thanks in advance, MAB ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT

Login before adding your answer.

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