CNV简单可视化
- 简单快速地看下CNV情况,拷贝自https://www.biostars.org/p/179503/
- 输入文件需包括3列:chr start_pos end_pos
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,并用不同颜色标注,以后再补上啦。
网友评论