Variance
1
0
Entering edit mode
David ▴ 860
@david-3335
Last seen 6.6 years ago
Hello, I'm newbie with R. I have a dataframe as follows. The microarray data has been normalized using spike in controls and the values shown are normalized log2 values. CondA CondB CondC CondD CondE geneA -6.19 -5.74 -5.82 -5 -5.59 geneB -6.33 -5.32 -5.6 -4.88 -5.39 geneC -6.15 -6.07 -5.6 -4.88 -5.9 geneD -6.57 -6.11 -6.36 -5.36 -5.96 geneD -6.74 -6.2 -5.49 -5.35 -5.95 geneE -6.75 -6.24 -5.73 -5.63 -6.02 From this small subset (in fact i have a larger dataframe) i would like to know which gene has the lowest variance. I would like to see is some of these genes could be used as reference genes for RT-PCr experiments. How can i plot and get the variance from this genes and see what would the best candidates to be used as reference genes. thanks, david
Microarray Microarray • 1.2k views
ADD COMMENT
0
Entering edit mode
@john-seers-ifr-1605
Last seen 10.2 years ago
Hi Something like this? geneA<-c(-6.19, -5.74, -5.82, -5, -5.59) geneB<-c(-6.33, -5.32, -5.6, -4.88, -5.39) geneC<-c(-6.15, -6.07, -5.6, -4.88, -5.9) geneD<-c(-6.57, -6.11, -6.36, -5.36, -5.96) geneD<-c(-6.74, -6.2, -5.49, -5.35, -5.95) geneE<-c(-6.75, -6.24, -5.73, -5.63, -6.02) mygenes<-rbind(geneA, geneB, geneC, geneD, geneE) colnames(mygenes)<-c("CondA", "CondB", "CondC", "CondD", "CondE") myvars<-apply(mygenes, 1, var) myvars[which(min(myvars) == myvars)] # geneA #0.18827 Note that this needs a matrix so you will need to convert your dataframe to work. (See ?data.matrix). Also I think using the min command will not always work to index the myvars, but it shows the idea. See ?plot for plotting. Regards J -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David martin Sent: 22 June 2009 13:56 To: bioconductor at stat.math.ethz.ch Subject: [BioC] Variance Hello, I'm newbie with R. I have a dataframe as follows. The microarray data has been normalized using spike in controls and the values shown are normalized log2 values. CondA CondB CondC CondD CondE geneA -6.19 -5.74 -5.82 -5 -5.59 geneB -6.33 -5.32 -5.6 -4.88 -5.39 geneC -6.15 -6.07 -5.6 -4.88 -5.9 geneD -6.57 -6.11 -6.36 -5.36 -5.96 geneD -6.74 -6.2 -5.49 -5.35 -5.95 geneE -6.75 -6.24 -5.73 -5.63 -6.02 From this small subset (in fact i have a larger dataframe) i would like to know which gene has the lowest variance. I would like to see is some of these genes could be used as reference genes for RT-PCr experiments. How can i plot and get the variance from this genes and see what would the best candidates to be used as reference genes. thanks, david _______________________________________________ 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
0
Entering edit mode
Thanks, It's working. To get he min value i run min = which.min(myvars) However, how do I know the calculated variance ?? as which.min returns the index but not the variance. thanks john seers (IFR) wrote: > Hi > > Something like this? > > > geneA<-c(-6.19, -5.74, -5.82, -5, -5.59) > geneB<-c(-6.33, -5.32, -5.6, -4.88, -5.39) > geneC<-c(-6.15, -6.07, -5.6, -4.88, -5.9) > geneD<-c(-6.57, -6.11, -6.36, -5.36, -5.96) > geneD<-c(-6.74, -6.2, -5.49, -5.35, -5.95) > geneE<-c(-6.75, -6.24, -5.73, -5.63, -6.02) > > > mygenes<-rbind(geneA, geneB, geneC, geneD, geneE) > colnames(mygenes)<-c("CondA", "CondB", "CondC", "CondD", > "CondE") > > myvars<-apply(mygenes, 1, var) > > myvars[which(min(myvars) == myvars)] > > > # geneA > #0.18827 > > Note that this needs a matrix so you will need to convert your dataframe > to work. (See ?data.matrix). Also I think using the min command will not > always work to index the myvars, but it shows the idea. > > See ?plot for plotting. > > Regards > > J > > > > > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David > martin > Sent: 22 June 2009 13:56 > To: bioconductor at stat.math.ethz.ch > Subject: [BioC] Variance > > Hello, > I'm newbie with R. > I have a dataframe as follows. The microarray data has been normalized > using spike in controls and the values shown are normalized log2 values. > > CondA CondB CondC CondD CondE > geneA -6.19 -5.74 -5.82 -5 -5.59 > geneB -6.33 -5.32 -5.6 -4.88 -5.39 > geneC -6.15 -6.07 -5.6 -4.88 -5.9 > geneD -6.57 -6.11 -6.36 -5.36 -5.96 > geneD -6.74 -6.2 -5.49 -5.35 -5.95 > geneE -6.75 -6.24 -5.73 -5.63 -6.02 > > From this small subset (in fact i have a larger dataframe) i would like > > to know which gene has the lowest variance. I would like to see is some > of these genes could be used as reference genes for RT-PCr experiments. > How can i plot and get the variance from this genes and see what would > the best candidates to be used as reference genes. > > thanks, > > david > > _______________________________________________ > 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 > > _______________________________________________ > 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 REPLY
0
Entering edit mode
Thanks, It's working. To get he min value i run min = which.min(myvars) However, how do I know the calculated variance ?? as which.min returns the index but not the variance. thanks john seers (IFR) wrote: > Hi > > Something like this? > > > geneA<-c(-6.19, -5.74, -5.82, -5, -5.59) > geneB<-c(-6.33, -5.32, -5.6, -4.88, -5.39) > geneC<-c(-6.15, -6.07, -5.6, -4.88, -5.9) > geneD<-c(-6.57, -6.11, -6.36, -5.36, -5.96) > geneD<-c(-6.74, -6.2, -5.49, -5.35, -5.95) > geneE<-c(-6.75, -6.24, -5.73, -5.63, -6.02) > > > mygenes<-rbind(geneA, geneB, geneC, geneD, geneE) > colnames(mygenes)<-c("CondA", "CondB", "CondC", "CondD", > "CondE") > > myvars<-apply(mygenes, 1, var) > > myvars[which(min(myvars) == myvars)] > > > # geneA > #0.18827 > > Note that this needs a matrix so you will need to convert your dataframe > to work. (See ?data.matrix). Also I think using the min command will not > always work to index the myvars, but it shows the idea. > > See ?plot for plotting. > > Regards > > J > > > > > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David > martin > Sent: 22 June 2009 13:56 > To: bioconductor at stat.math.ethz.ch > Subject: [BioC] Variance > > Hello, > I'm newbie with R. > I have a dataframe as follows. The microarray data has been normalized > using spike in controls and the values shown are normalized log2 values. > > CondA CondB CondC CondD CondE > geneA -6.19 -5.74 -5.82 -5 -5.59 > geneB -6.33 -5.32 -5.6 -4.88 -5.39 > geneC -6.15 -6.07 -5.6 -4.88 -5.9 > geneD -6.57 -6.11 -6.36 -5.36 -5.96 > geneD -6.74 -6.2 -5.49 -5.35 -5.95 > geneE -6.75 -6.24 -5.73 -5.63 -6.02 > > From this small subset (in fact i have a larger dataframe) i would like > > to know which gene has the lowest variance. I would like to see is some > of these genes could be used as reference genes for RT-PCr experiments. > How can i plot and get the variance from this genes and see what would > the best candidates to be used as reference genes. > > thanks, > > david > > _______________________________________________ > 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 > > _______________________________________________ > 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 REPLY
0
Entering edit mode
Hi David Ah, yes. which.min is better. For instance, type in > myvars[which.min(myvars)] geneA 0.18827 > Regards John -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David martin Sent: 22 June 2009 15:41 To: bioconductor at stat.math.ethz.ch Subject: Re: [BioC] Variance Thanks, It's working. To get he min value i run min = which.min(myvars) However, how do I know the calculated variance ?? as which.min returns the index but not the variance. thanks john seers (IFR) wrote: > Hi > > Something like this? > > > geneA<-c(-6.19, -5.74, -5.82, -5, -5.59) > geneB<-c(-6.33, -5.32, -5.6, -4.88, -5.39) > geneC<-c(-6.15, -6.07, -5.6, -4.88, -5.9) > geneD<-c(-6.57, -6.11, -6.36, -5.36, -5.96) > geneD<-c(-6.74, -6.2, -5.49, -5.35, -5.95) > geneE<-c(-6.75, -6.24, -5.73, -5.63, -6.02) > > > mygenes<-rbind(geneA, geneB, geneC, geneD, geneE) > colnames(mygenes)<-c("CondA", "CondB", "CondC", "CondD", > "CondE") > > myvars<-apply(mygenes, 1, var) > > myvars[which(min(myvars) == myvars)] > > > # geneA > #0.18827 > > Note that this needs a matrix so you will need to convert your dataframe > to work. (See ?data.matrix). Also I think using the min command will not > always work to index the myvars, but it shows the idea. > > See ?plot for plotting. > > Regards > > J > > > > > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David > martin > Sent: 22 June 2009 13:56 > To: bioconductor at stat.math.ethz.ch > Subject: [BioC] Variance > > Hello, > I'm newbie with R. > I have a dataframe as follows. The microarray data has been normalized > using spike in controls and the values shown are normalized log2 values. > > CondA CondB CondC CondD CondE > geneA -6.19 -5.74 -5.82 -5 -5.59 > geneB -6.33 -5.32 -5.6 -4.88 -5.39 > geneC -6.15 -6.07 -5.6 -4.88 -5.9 > geneD -6.57 -6.11 -6.36 -5.36 -5.96 > geneD -6.74 -6.2 -5.49 -5.35 -5.95 > geneE -6.75 -6.24 -5.73 -5.63 -6.02 > > From this small subset (in fact i have a larger dataframe) i would like > > to know which gene has the lowest variance. I would like to see is some > of these genes could be used as reference genes for RT-PCr experiments. > How can i plot and get the variance from this genes and see what would > the best candidates to be used as reference genes. > > thanks, > > david > > _______________________________________________ > 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 > > _______________________________________________ > 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 > _______________________________________________ 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 REPLY
0
Entering edit mode
Thanks, One extra question, do i need to compute an extra test to make sure that the lowest variance is significant (pvalue ??)??? thanks john seers (IFR) wrote: > Hi David > > Ah, yes. which.min is better. > > For instance, type in > >> myvars[which.min(myvars)] > geneA > 0.18827 > > > Regards > > > John > > > > -----Original Message----- > From: bioconductor-bounces at stat.math.ethz.ch > [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David > martin > Sent: 22 June 2009 15:41 > To: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] Variance > > Thanks, > It's working. > To get he min value i run > min = which.min(myvars) > However, how do I know the calculated variance ?? as which.min returns > the index but not the variance. > > thanks > > > john seers (IFR) wrote: >> Hi >> >> Something like this? >> >> >> geneA<-c(-6.19, -5.74, -5.82, -5, -5.59) >> geneB<-c(-6.33, -5.32, -5.6, -4.88, -5.39) >> geneC<-c(-6.15, -6.07, -5.6, -4.88, -5.9) >> geneD<-c(-6.57, -6.11, -6.36, -5.36, -5.96) >> geneD<-c(-6.74, -6.2, -5.49, -5.35, -5.95) >> geneE<-c(-6.75, -6.24, -5.73, -5.63, -6.02) >> >> >> mygenes<-rbind(geneA, geneB, geneC, geneD, geneE) >> colnames(mygenes)<-c("CondA", "CondB", "CondC", "CondD", >> "CondE") >> >> myvars<-apply(mygenes, 1, var) >> >> myvars[which(min(myvars) == myvars)] >> >> >> # geneA >> #0.18827 >> >> Note that this needs a matrix so you will need to convert your > dataframe >> to work. (See ?data.matrix). Also I think using the min command will > not >> always work to index the myvars, but it shows the idea. >> >> See ?plot for plotting. >> >> Regards >> >> J >> >> >> >> >> -----Original Message----- >> From: bioconductor-bounces at stat.math.ethz.ch >> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of David >> martin >> Sent: 22 June 2009 13:56 >> To: bioconductor at stat.math.ethz.ch >> Subject: [BioC] Variance >> >> Hello, >> I'm newbie with R. >> I have a dataframe as follows. The microarray data has been normalized > >> using spike in controls and the values shown are normalized log2 > values. >> CondA CondB CondC CondD CondE >> geneA -6.19 -5.74 -5.82 -5 -5.59 >> geneB -6.33 -5.32 -5.6 -4.88 -5.39 >> geneC -6.15 -6.07 -5.6 -4.88 -5.9 >> geneD -6.57 -6.11 -6.36 -5.36 -5.96 >> geneD -6.74 -6.2 -5.49 -5.35 -5.95 >> geneE -6.75 -6.24 -5.73 -5.63 -6.02 >> >> From this small subset (in fact i have a larger dataframe) i would > like >> to know which gene has the lowest variance. I would like to see is > some >> of these genes could be used as reference genes for RT-PCr > experiments. >> How can i plot and get the variance from this genes and see what would > >> the best candidates to be used as reference genes. >> >> thanks, >> >> david >> >> _______________________________________________ >> 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 >> >> _______________________________________________ >> 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 > > _______________________________________________ > 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 > > _______________________________________________ > 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 REPLY

Login before adding your answer.

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