[BioC] computation of average of all probes but not the actual

Herve Pages hpages at fhcrc.org
Mon May 12 21:00:53 CEST 2008


Hi Balazs,

Dr Balazs Gyorffy wrote:
> Hi All,
> 
> Lets say, we have a table, and want to divide the values with the row averages:
> 
> mytable <- array(1:20, dim=c(4,5))
> averages <- apply(mytable, 1, mean)
> result <- mytable/averages
> 
> How can I make this in a way in which each probe is divided by an average which
> was calulated by all probes excluding the actual probe?

Some elementary maths will show you that "excluding the actual probe" transforms
each value in the current result by the following formula:

     x' <- (N - 1) / (N/x - 1)

where N is the number of cols, x is any value in the current result and x' the
value after "excluding the actual probe". So you just have to do:

     result2 <- (5 - 1) / (5/result - 1)

which gives the same result as with Thomas' code but in a more efficient way.

Cheers,
H.


> 
> Thank you:
> Balazs
> 
> 
> 
> -------------------------
> Balázs GYÖRFFY MD, PhD
> Children's Hospital Boston Informatics Program
> Harvard-MIT Health Sciences and Technology
> 300 Longwood Avenue, Boston, USA
> Enders 150.6
> Tel: +1 617 919 2654
> Email: zsalab2 at yahoo.com
> 
> 
>       Nicht vergessen! Am Sonntag, den 11. Mai ist Muttertag 
> Geschenkideen, Gedichte & mehr: www.yahoo.de/muttertag
> 
> _______________________________________________
> 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