In several manuals (example) on ChIP-seq analysis they pre-select, for instance +1000bp and -1000bp from the TSS as the "promoter-bound" regions:
peakAnno_bcl11b <- ChIPseeker::annotatePeak(peak = 'bcl11b_peaks.narrowPeak', TxDb=txdb, tssRegion=c(-1000, 1000) )
which produces an object with a slot
@anno in which each peak is assigned either "Promoter",
"5’ UTR", "3’ UTR", "Exon", "Intron", etc.
So one would expect that those peaks that were bound at the promoter regions would be the ones that are retained for the downstream analysis like GO functional enrichment, etc.
But then they go ahead and use all the called peaks in the initial annotation object for the enrichment:
ego <- enrichGO(gene = peakAnno_bcl11b$geneId, keyType = "ENTREZID", OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", qvalueCutoff = 0.05, readable = TRUE)
What was the purpose of restricting the TSS search region to the
c(-1000,+1000) region to begin with then?
As you say, the purpose of adding the TSS search region is to define the "Promoter" annotation. You can certainly break out the enrichment analysis by annotation type if that is desired. The purpose of these manuals is not to proscribe an analysis (which will be dependent on your question), but to show how the tools can be used. The first example shows how annotations can be defined, the second shows how enrichment can be performed; by filtering peaks you can make the enrichment (or plots of enrichment) annotation-aware.