R绘图

作者: fatlady | 来源:发表于2019-01-22 09:36 被阅读17次

CNV简单可视化

library("ggplot2")

chr <- c("chr1", "chr2", "chr2")
start <- c(86000000, 70250000, 203050000)
end <- c(117150000, 70500000, 204650000)
center <- start + (end - start)/2
ploidy <- c(1, 3, 3)

ploidy_df <- data.frame(chr, start, end, center, ploidy)

ggplot(ploidy_df, aes(x=center, y=ploidy)) + 
  geom_point() +
  geom_segment(aes(x=start, y=ploidy, xend=end, yend=ploidy, colour="segment")) + 
  geom_hline(y=2, linetype=2,yintercept = 0) +
  facet_wrap(~chr) +
  xlab("Position") +
  theme_bw()
CNV可视化

可以根据需要增加一列表示DUP/DEL,并用不同颜色标注,以后再补上啦。

相关文章

网友评论

      本文标题:R绘图

      本文链接:https://www.haomeiwen.com/subject/ttakjqtx.html