Hi Michael,
Thank you for selecting ChIPpeakAnno as your annotation tool. In function assignChromosomeRegion, you can define the exon, intron, 5'UTR, 3'UTR by youself or just input a TxDb object and ChIPpeakAnno will generate the exon, introns 5'UTR and 3'UTR by the functions exon, intronsByTranscript, fiveUTRsByTranscript and threeUTRsByTranscript. The promoters are generated by promoter function with input proximal.promoter.cutoff parameter (upstream to TSS). As you said, a peak will frequently overlap with multiple annotations, the parameter precedence is designed to avoiding double count for annotations. It is to say if no precedence specified, when a peak overlap with both promoter and 5'UTR, both promoter and 5'UTR will be incremented. If a precedence order is specified, for example, if promoter is specified before 5'UTR, then only promoter will be incremented for the same example. And you can also try nucleotideLevel parameter. nucleotideLevel parameter provide the choice between peak centric and nucleotide centric view. To see more details, please try to get help by ?assignChromosomeRegion.
try to play with assignChromosomeRegion like this to see the difference:
library(ChIPpeakAnno)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
TxDb <- TxDb.Hsapiens.UCSC.hg19.knownGene
exons <- exons(TxDb)
acr <- assignChromosomeRegion(exons, TxDb=TxDb)
barplot(acr$percentage)
acr2 <- assignChromosomeRegion(exons, TxDb=TxDb, precedence=c("Exons", "fiveUTRs", "threeUTRs", "Introns", "Promoters"))
barplot(acr2$percentage)
acr3 <- assignChromosomeRegion(exons, TxDb=TxDb, nucleotideLevel=TRUE)
barplot(acr3$percentage)