生信修炼生信图可视化大全R语言训练

箭头基因结构图gggenes

2019-10-25  本文已影响0人  吴十三和小可爱的札记

总共就几个功能参数

geom_gene_arrow():绘制箭头基因图

geom_gene_label():绘制基因labels

geom_subgene_arrow()

geom_subgene_label()

make_alignment_dummies()

theme_genes()

安装和数据准备

# install.packages("gggenes")
sub_data <- subset(example_genes, 
                   molecule == "Genome4"|molecule == "Genome5")
f <- list(
  geom_gene_arrow(),
  facet_wrap(~ molecule, scales = "free", ncol = 1) ,
  scale_fill_brewer(palette = "Set3"),
  theme_genes())

基本箭头图

ggplot(sub_data, 
       aes(xmin = start, xmax = end, y = molecule, fill = gene,
           forward = direction)) + f
arrow.png

标记基因名称

ggplot(sub_data, 
       aes(xmin = start, xmax = end, y = molecule, fill = gene,
           forward = direction)) + f +
  geom_gene_label(aes(label = gene)) + 
  theme(legend.position='none')
gene_label.png
上一篇下一篇

猜你喜欢

热点阅读