美文网首页
2022年喜欢的100个R包--(一)gggenes

2022年喜欢的100个R包--(一)gggenes

作者: 纵纵纵小鸮 | 来源:发表于2022-01-11 16:40 被阅读0次

画染色体上的基因分布图;

代码:

install.packages("gggenes")

library(ggplot2)

library(gggenes)

mydata<-read.csv("YSDR-annotation.txt", sep="\t")

mydata

p1<-ggplot(mydata, aes(xmin=start,xmax=end,y=chr,fill=gene))+

  geom_gene_arrow() +

  scale_x_continuous(limits = c(0, 200000),breaks=seq(0,200000,25000))+

  facet_wrap(~ chr, scales = "free", ncol = 1, nrow=1) +

  scale_fill_brewer(palette = "Set3")+

  theme(legend.position = "bottom" )+

  #geom_point(df, mapping=aes(x=BP,y=10),color="orchid")+

  theme_genes()

p1

图:

相关文章

网友评论

      本文标题:2022年喜欢的100个R包--(一)gggenes

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