computation of average of all probes but not the actual
2
0
Entering edit mode
@dr-gyorffy-balazs-619
Last seen 10.2 years ago
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? 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
probe probe • 709 views
ADD COMMENT
0
Entering edit mode
Thomas Girke ★ 1.7k
@thomas-girke-993
Last seen 8 months ago
United States
You can try: mytable <- array(1:20, dim=c(4,5)) averages <- apply(mytable, 1, function(x) sapply(1:length(x), function(y) mean(x[-y]))) averages <- t(averages) result <- mytable/averages Thomas On Sun 05/11/08 01:53, 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? > > 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 > -- Thomas Girke Assistant Professor of Bioinformatics Director, IIGB Bioinformatic Facility Center for Plant Cell Biology (CEPCEB) Institute for Integrative Genome Biology (IIGB) Department of Botany and Plant Sciences 1008 Noel T. Keen Hall University of California Riverside, CA 92521 E-mail: thomas.girke at ucr.edu Website: http://faculty.ucr.edu/~tgirke Ph: 951-827-2469 Fax: 951-827-4437
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 7 hours ago
Seattle, WA, United States
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
ADD COMMENT

Login before adding your answer.

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