Hi,
for any gff-based annotation prepared with gffToGRanges() please use `
annotateWithFeatures()` instead of `annotateWithGeneParts()` for the final step.
annotateWithGeneParts() expects as features (second arg) a "GRangesList object containing GRanges object for promoter, exons, introns and transcription start sites, or simply output of readTranscriptFeatures function",
while annotateWithFeatures() just needs "a named GRangesList object containing GRanges objects different set of features".
To fix your code:
```
gene.obj = gffToGRanges("contigs.emapper.genepred.gff")
head(gene.obj)
split = as(split(gene.obj, gene.obj$type), "GRangesList")
head(split)
diffAnn=
annotateWithFeatures(as(myDiffFiltered,"GRanges"), split)
```
Best,
Alex