boxplots on summarized data
2
0
Entering edit mode
@dennisburianfaagov-2126
Last seen 7.6 years ago
I'm having a time generating boxplots across chips on summarized data for more than one gene at a time. I want a set of boxplots for a subset of the genes, say the 10th to the 20th genes in the ExpressionSet. I expect this is an R list question but since the data is an expression set decided to post it here instead. I've tried: boxplot(exprs(x)[10:20]) boxplot(exprs(x)[10,:20,]) boxplot(exprs(x)c(10,11,12,13,14,15,16,17,18,19,20)) these all return a single boxplot with the expression values for all chips from all 11 genes in the same boxplot. boxplot(exprs(x)[10]) gives me a boxplot for one gene. exprs(x)[10:20] returns the data for the 11 genes in a table. R 2.6.0 x86_64-unknown-linux-gnu Biobase_1.16.1 affy_1.16.0 I thought I had some understanding of subsetting and the last line of code to get just the tabular data back validated that thought but now I'm mostly just confused. thanks, DB Dennis Burian, Ph.D. Functional Genomics Group Civil Aerospace Medical Institute, AAM-610 6500 S. MacArthur Blvd. Oklahoma City OK 73169 405-954-6087 dennis.burian at faa.gov
• 2.5k views
ADD COMMENT
0
Entering edit mode
Jenny Drnevich ★ 2.2k
@jenny-drnevich-382
Last seen 10.2 years ago
Hi Dennis, In all your examples you aren't subsetting the exprs matrix correctly - it has two dimensions, but you're only subsetting on one. First of all, > exprs(x)[10:20] doesn't give you the data for those 11 genes in a table, it only returns the data for those genes from the first array. However, that may not be your only problem. Let me make sure I understand what you want to do: for each gene you want one box showing the mean, percentiles, etc. for the group of arrays, and all these boxes on one plot. Working through an example: >exprs(x)[10:20 , 1:5] This gives you the data matrix of genes 10-20 on arrays 1-5, but doing this: >boxplot(exprs(x)[10:20 , 1:5]) combines all the values into one boxplot because exprs(x) is a matrix. Next step: >boxplot(data.frame(exprs(x)[10:20 , 1:5])) Now you have multiple boxes, but they are for each array, not each gene, so you have to transpose the data: >boxplot(data.frame(t(exprs(x)[10:20 , 1:5]))) Is what you want? Cheers, Jenny boxplot(data.frame(exprs(x)[10:20,] At 02:44 PM 1/22/2008, Dennis.Burian at faa.gov wrote: >I'm having a time generating boxplots across chips on summarized data for >more than one gene at a time. I want a set of boxplots for a subset of the >genes, say the 10th to the 20th genes in the ExpressionSet. I expect this >is an R list question but since the data is an expression set decided to >post it here instead. > >I've tried: >boxplot(exprs(x)[10:20]) >boxplot(exprs(x)[10,:20,]) >boxplot(exprs(x)c(10,11,12,13,14,15,16,17,18,19,20)) >these all return a single boxplot with the expression values for all chips >from all 11 genes in the same boxplot. > >boxplot(exprs(x)[10]) gives me a boxplot for one gene. >exprs(x)[10:20] returns the data for the 11 genes in a table. > >R 2.6.0 >x86_64-unknown-linux-gnu >Biobase_1.16.1 affy_1.16.0 > >I thought I had some understanding of subsetting and the last line of code >to get just the tabular data back validated that thought but now I'm mostly >just confused. > >thanks, DB > >Dennis Burian, Ph.D. >Functional Genomics Group >Civil Aerospace Medical Institute, AAM-610 >6500 S. MacArthur Blvd. >Oklahoma City OK 73169 >405-954-6087 >dennis.burian at faa.gov > >_______________________________________________ >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 Jenny Drnevich, Ph.D. Functional Genomics Bioinformatics Specialist W.M. Keck Center for Comparative and Functional Genomics Roy J. Carver Biotechnology Center University of Illinois, Urbana-Champaign 330 ERML 1201 W. Gregory Dr. Urbana, IL 61801 USA ph: 217-244-7355 fax: 217-265-5066 e-mail: drnevich at uiuc.edu
ADD COMMENT
0
Entering edit mode
That's it, thanks for the quick reply. Dennis Burian, Ph.D. Functional Genomics Group Civil Aerospace Medical Institute, AAM-610 6500 S. MacArthur Blvd. Oklahoma City OK 73169 405-954-6087 dennis.burian at faa.gov Jenny Drnevich <drnevich at="" uiuc.ed="" u=""> To Dennis M Burian/AMC/FAA at FAA, 01/22/2008 03:15 Bioconductor at stat.math.ethz.ch PM cc Subject Re: [BioC] boxplots on summarized data Hi Dennis, In all your examples you aren't subsetting the exprs matrix correctly - it has two dimensions, but you're only subsetting on one. First of all, > exprs(x)[10:20] doesn't give you the data for those 11 genes in a table, it only returns the data for those genes from the first array. However, that may not be your only problem. Let me make sure I understand what you want to do: for each gene you want one box showing the mean, percentiles, etc. for the group of arrays, and all these boxes on one plot. Working through an example: >exprs(x)[10:20 , 1:5] This gives you the data matrix of genes 10-20 on arrays 1-5, but doing this: >boxplot(exprs(x)[10:20 , 1:5]) combines all the values into one boxplot because exprs(x) is a matrix. Next step: >boxplot(data.frame(exprs(x)[10:20 , 1:5])) Now you have multiple boxes, but they are for each array, not each gene, so you have to transpose the data: >boxplot(data.frame(t(exprs(x)[10:20 , 1:5]))) Is what you want? Cheers, Jenny boxplot(data.frame(exprs(x)[10:20,] At 02:44 PM 1/22/2008, Dennis.Burian at faa.gov wrote: >I'm having a time generating boxplots across chips on summarized data for >more than one gene at a time. I want a set of boxplots for a subset of the >genes, say the 10th to the 20th genes in the ExpressionSet. I expect this >is an R list question but since the data is an expression set decided to >post it here instead. > >I've tried: >boxplot(exprs(x)[10:20]) >boxplot(exprs(x)[10,:20,]) >boxplot(exprs(x)c(10,11,12,13,14,15,16,17,18,19,20)) >these all return a single boxplot with the expression values for all chips >from all 11 genes in the same boxplot. > >boxplot(exprs(x)[10]) gives me a boxplot for one gene. >exprs(x)[10:20] returns the data for the 11 genes in a table. > >R 2.6.0 >x86_64-unknown-linux-gnu >Biobase_1.16.1 affy_1.16.0 > >I thought I had some understanding of subsetting and the last line of code >to get just the tabular data back validated that thought but now I'm mostly >just confused. > >thanks, DB > >Dennis Burian, Ph.D. >Functional Genomics Group >Civil Aerospace Medical Institute, AAM-610 >6500 S. MacArthur Blvd. >Oklahoma City OK 73169 >405-954-6087 >dennis.burian at faa.gov > >_______________________________________________ >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 Jenny Drnevich, Ph.D. Functional Genomics Bioinformatics Specialist W.M. Keck Center for Comparative and Functional Genomics Roy J. Carver Biotechnology Center University of Illinois, Urbana-Champaign 330 ERML 1201 W. Gregory Dr. Urbana, IL 61801 USA ph: 217-244-7355 fax: 217-265-5066 e-mail: drnevich at uiuc.edu
ADD REPLY
0
Entering edit mode
@joern-toedling-1244
Last seen 10.2 years ago
Hi Dennis, the "exprs" method returns a matrix and for a matrix there's no special way defined to treat each column individually. Try boxplot(data.frame(exprs(x))) gives you the boxplots for all genes, one for each sample. With matrices, the index in front of the comma specifies the rows, the one afterwards the columns. Since in R matrices are really just vectors with an additional dimensions specified, specifying only one index also works, your second example exprs(x)[10:20] is equivalent to exprs(x)[10:20,1] if your matrix has at least 20 rows. If the expression matrix, say, would have only 10 rows, this index would return the last entry of the first column and all entries of the second column, though. Regards, Joern > I'm having a time generating boxplots across chips on summarized data for > more than one gene at a time. I want a set of boxplots for a subset of > the > genes, say the 10th to the 20th genes in the ExpressionSet. I expect this > is an R list question but since the data is an expression set decided to > post it here instead. > > I've tried: > boxplot(exprs(x)[10:20]) > boxplot(exprs(x)[10,:20,]) > boxplot(exprs(x)c(10,11,12,13,14,15,16,17,18,19,20)) > these all return a single boxplot with the expression values for all chips > from all 11 genes in the same boxplot. > > boxplot(exprs(x)[10]) gives me a boxplot for one gene. > exprs(x)[10:20] returns the data for the 11 genes in a table. > > R 2.6.0 > x86_64-unknown-linux-gnu > Biobase_1.16.1 affy_1.16.0 > > I thought I had some understanding of subsetting and the last line of code > to get just the tabular data back validated that thought but now I'm > mostly > just confused. > > thanks, DB > > Dennis Burian, Ph.D. > Functional Genomics Group > Civil Aerospace Medical Institute, AAM-610 > 6500 S. MacArthur Blvd. > Oklahoma City OK 73169 > 405-954-6087 > dennis.burian at faa.gov > >
ADD COMMENT

Login before adding your answer.

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