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)
plotDistToTSS(peakAnnoList,ylab = "Opening sites (%) (5'->3')",
title = paste0("Distribution of opening loci relative to TSS"))