Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.25 KB

File metadata and controls

41 lines (31 loc) · 1.25 KB
library(ggplot2)
library(ggpointdensity) 
library(viridis)

library("ChIPseeker")
library("GenomicFeatures")



poppy_TxDb <- makeTxDbFromGFF("D:/001poppy_atac_new_genome/Papaver_somniferum.gene.gff3")
setwd("D:/001poppy_atac_new_genome/ATAC_peak/")
files <- list.files(pattern = "*.narrowPeak")
files_list <- as.list(files)
names(files_list) <- c("Capsule","Petal","Stem","Fine_Root","Leaf","Tap_Root")
peakAnnoList <- lapply(files_list, annotatePeak, TxDb=poppy_TxDb,
                       tssRegion=c(-3000, 3000), verbose=FALSE)

pie_data <- rbind()
for (tissue in c("Capsule","Petal","Stem","Fine_Root","Leaf","Tap_Root")) {
  result_data <- peakAnnoList[[tissue]]@annoStat
  result_data[,3] <- tissue
  pie_data <- rbind(result_data,pie_data)
}
colnames(pie_data) <- c("Feature","Percentage","Tissue")

library(RColorBrewer)
display.brewer.all()
color_name <- brewer.pal(11,"Set3")


ggplot(pie_data, aes(x="", y=Percentage, group=Feature, color=Feature, fill=Feature)) +
  geom_bar(width = 1, stat = "identity") +
  coord_polar("y", start=0) + facet_wrap(~ Tissue) +
  theme(axis.text = element_blank(),
        axis.ticks = element_blank(),
        panel.grid  = element_blank())+
  scale_fill_manual(values = color_name)