Ideas for plotting
1
0
Entering edit mode
@priscila-grynberg-3196
Last seen 10.2 years ago
Dear BioCs, I'd like to create a special volcano plot. Considering that I have genes with high B values, and with low B values but with adj.P.Values significantly. I'd like to highlight those with B and adj,P.values positive and those presenting only the adj.P.values positive. Is it possible to do that? Thanks for your help. -- Priscila Grynberg, B.Sc., M.Sc. Doutoranda em Bioinformática (Bioinformatics D.Sc student) Laboratório de Genética Bioquímica Universidade Federal de Minas Gerais Tel: +55 31 3409-2628 CV: http://lattes.cnpq.br/8808643075395963 [[alternative HTML version deleted]]
• 822 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States
Hi Priscila, Priscila Grynberg wrote: > Dear BioCs, > I'd like to create a special volcano plot. Considering that I have genes > with high B values, and with low B values but with adj.P.Values > significantly. I'd like to highlight those with B and adj,P.values positive > and those presenting only the adj.P.values positive. > > Is it possible to do that? Of course! But you might have to do the plotting by hand rather than using a particular function. We can use the example for lmFit: sd <- 0.3*sqrt(4/rchisq(100,df=4)) y <- matrix(rnorm(100*6,sd=sd),100,6) rownames(y) <- paste("Gene",1:100) y[1:2,4:6] <- y[1:2,4:6] + 2 design <- cbind(Grp1=1,Grp2vs1=c(0,0,0,1,1,1)) options(digit=3) # Ordinary fit fit <- lmFit(y,design) fit <- eBayes(fit) plot(fit$coef[,2], fit$lods[,2], pch = 16, cex = 0.35, xlab = "log Fold Change", ylab = "log Odds") bind <- fit$lods[,2] > 0 points(fit$coef[bind,2], fit$lods[bind,2], pch = 16, cex = 0.5, col = "blue") pind <- p.adjust(fit$p.value[,2], "BH") < 0.05 points(fit$coef[pind,2], fit$lods[pind,2], pch = 16, cex = 0.5, col = "red") These happen to color the same points, but from what you describe you will have both blue and red points. Best, Jim > > Thanks for your help. > > > > -------------------------------------------------------------------- ---- > > _______________________________________________ > 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 -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826
ADD COMMENT
0
Entering edit mode
Dear James, thanks for your help! I produced a plot exactly how I was imaging. Priscila On Tue, Aug 18, 2009 at 10:17 AM, James W. MacDonald <jmacdon@med.umich.edu>wrote: > Hi Priscila, > > Priscila Grynberg wrote: > >> Dear BioCs, >> I'd like to create a special volcano plot. Considering that I have genes >> with high B values, and with low B values but with adj.P.Values >> significantly. I'd like to highlight those with B and adj,P.values >> positive >> and those presenting only the adj.P.values positive. >> >> Is it possible to do that? >> > > Of course! But you might have to do the plotting by hand rather than using > a particular function. > > We can use the example for lmFit: > > sd <- 0.3*sqrt(4/rchisq(100,df=4)) > y <- matrix(rnorm(100*6,sd=sd),100,6) > rownames(y) <- paste("Gene",1:100) > y[1:2,4:6] <- y[1:2,4:6] + 2 > design <- cbind(Grp1=1,Grp2vs1=c(0,0,0,1,1,1)) > options(digit=3) > > # Ordinary fit > fit <- lmFit(y,design) > fit <- eBayes(fit) > > plot(fit$coef[,2], fit$lods[,2], pch = 16, cex = 0.35, > xlab = "log Fold Change", ylab = "log Odds") > bind <- fit$lods[,2] > 0 > points(fit$coef[bind,2], fit$lods[bind,2], pch = 16, cex = 0.5, col = > "blue") > pind <- p.adjust(fit$p.value[,2], "BH") < 0.05 > points(fit$coef[pind,2], fit$lods[pind,2], pch = 16, cex = 0.5, col = > "red") > > These happen to color the same points, but from what you describe you will > have both blue and red points. > > Best, > > Jim > > >> Thanks for your help. >> >> >> >> ------------------------------------------------------------------- ----- >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@stat.math.ethz.ch >> 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 > Douglas Lab > University of Michigan > Department of Human Genetics > 5912 Buhl > 1241 E. Catherine St. > Ann Arbor MI 48109-5618 > 734-615-7826 > -- Priscila Grynberg, B.Sc., M.Sc. Doutoranda em Bioinformática (Bioinformatics D.Sc student) Laboratório de Genética Bioquímica Universidade Federal de Minas Gerais Tel: +55 31 3409-2628 CV: http://lattes.cnpq.br/8808643075395963 [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

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