l*e
2 楼
想比较两样品表达谱的相似性,如何作出x-y轴散点图,>log2的红色,中间的灰色。对matlab不懂,stanford 的SAM怎么用不了?
多谢!
多谢!
l*e
4 楼
R是不是也可以做到?有高人贴个程序或者样本么,多谢
l*1
6 楼
pls refer
> posted on FRIDAY, JULY 6, 2012
Fix Overplotting with Colored Contour Lines
I saw this plot in the supplement of a recent paper comparing microarray
results to RNA-seq results. Nothing earth-shattering in the paper - you've
probably seen a similar comparison many times before - but I liked how they
solved the overplotting problem using heat-colored contour lines to indicate
density. I asked how to reproduce this figure using R on Stack Exchange,
and my question was quickly answered by Christophe Lalanne.
Here's the R code to generate the data and all the figures here.
# Generate some data
library(MASS)
set.seed(101)
n X # A color palette from blue to yellow to red
library(RColorBrewer)
k my.cols ## compute 2D kernel density, see MASS book, pp. 130-131
z # Make the base plot
plot(X, xlab="X label", ylab="Y label", pch=19, cex=.4)
# Draw the colored contour lines
contour(z, drawlabels=FALSE, nlevels=k, col=my.cols, add=TRUE, lwd=2)
# Add lines for the mean of X and Y
abline(h=mean(X[,2]), v=mean(X[,1]), col="gray", lwd=1.5)
# Add the correlation coefficient to the top left corner
legend("topleft", paste("R=", round(cor(X)[1,2],3)), bty="n")
## Other methods to fix overplotting
# Make points smaller - use a single pixel as the plotting charachter
plot(X, pch=".")
# Hexbinning
library(hexbin)
plot(hexbin(X[,1], X[,2]))
# Make points semi-transparent
library(ggplot2)
qplot(X[,1], X[,2], alpha=I(.1))
# The smoothScatter function (graphics package)
smoothScatter(X)
*****
cited
from
http://gettinggeneticsdone.blogspot.co.uk/2012/07/fix-overplott
ps: original hint was from one former mitbbs post
同主题阅读:R: how to convert a scatter plot to a contour color plot?
[版面:统计][首篇作者:StatsGuy] , 2011年03月31日15:17
http://www.mitbbs.com/article_t/Statistics/31271563.html
【在 l******e 的大作中提到】
: R是不是也可以做到?有高人贴个程序或者样本么,多谢
> posted on FRIDAY, JULY 6, 2012
Fix Overplotting with Colored Contour Lines
I saw this plot in the supplement of a recent paper comparing microarray
results to RNA-seq results. Nothing earth-shattering in the paper - you've
probably seen a similar comparison many times before - but I liked how they
solved the overplotting problem using heat-colored contour lines to indicate
density. I asked how to reproduce this figure using R on Stack Exchange,
and my question was quickly answered by Christophe Lalanne.
Here's the R code to generate the data and all the figures here.
# Generate some data
library(MASS)
set.seed(101)
n X # A color palette from blue to yellow to red
library(RColorBrewer)
k my.cols ## compute 2D kernel density, see MASS book, pp. 130-131
z # Make the base plot
plot(X, xlab="X label", ylab="Y label", pch=19, cex=.4)
# Draw the colored contour lines
contour(z, drawlabels=FALSE, nlevels=k, col=my.cols, add=TRUE, lwd=2)
# Add lines for the mean of X and Y
abline(h=mean(X[,2]), v=mean(X[,1]), col="gray", lwd=1.5)
# Add the correlation coefficient to the top left corner
legend("topleft", paste("R=", round(cor(X)[1,2],3)), bty="n")
## Other methods to fix overplotting
# Make points smaller - use a single pixel as the plotting charachter
plot(X, pch=".")
# Hexbinning
library(hexbin)
plot(hexbin(X[,1], X[,2]))
# Make points semi-transparent
library(ggplot2)
qplot(X[,1], X[,2], alpha=I(.1))
# The smoothScatter function (graphics package)
smoothScatter(X)
*****
cited
from
http://gettinggeneticsdone.blogspot.co.uk/2012/07/fix-overplott
ps: original hint was from one former mitbbs post
同主题阅读:R: how to convert a scatter plot to a contour color plot?
[版面:统计][首篇作者:StatsGuy] , 2011年03月31日15:17
http://www.mitbbs.com/article_t/Statistics/31271563.html
【在 l******e 的大作中提到】
: R是不是也可以做到?有高人贴个程序或者样本么,多谢
v*y
13 楼
毛泽东。。。生卒年 。。。
相关阅读
给病人少打麻药的牙医现在庆祝为时尚早,张锋CRISPR基因编辑专利仍然会被无效的!需要审稿的请进求审稿机会,蛋白质分离,质谱-色谱分析,新型色谱材料制备,聚合物表面改性云南省烟草农业科学研究院 人才招聘做个普通的抗体多少钱? 哪家公司比较好?谢谢!Gene Synthesis找工作关于工资和title请教mitbbs各位老神,小生想赴美博后版上有申请DOD lung concept award 的吗?五十万元,一场官司,一个神经科学家的深渊洪森:杨振宁如不放弃美国籍将面临55%遗产税求paper,多谢!两个周末的真事实验数据被盗了!quit PhD有什么后果吗?发现一篇关于转基因的文章,很有意思FMD on Diabetes攒人品,转让审稿机会请问做2D western blot靠谱的公司