I noticed this when reading the codes at StatQuest: Filtering genes with low read counts. (line 97 - 103):
If you used htseq-count to count the reads per gene, then the last five rows of data are not for specific genes, but are summaries of how the counting went. We must remove them from our new data frame, or else edgeR will treat those last 5 rows as individual genes and throw off the statistics.
So you have to filter out the last five lines in the raw *.htseq, otherwise, your DGEList object will keep containing that summary information:
> head(raw.data)
id wt1 wt2 wt3 ko1 ko2 ko3
1 LOC001_0001.1 0 0 0 0 0 0
2 LOC001_0002.1 82 71 77 91 79 84
3 LOC001_0003.1 2651 2785 2759 2802 2142 3117
4 LOC001_0004.1 543 436 455 629 430 550
5 LOC001_0005.1 399 373 324 420 279 386
6 LOC001_0006.1 108 91 82 116 88 125
> y <- DGEList(counts = raw.data[, 2:ncol(raw.data)], genes = raw.data[, 1])
> tail(n = 5, y$genes)
genes
12858 __no_feature
12859 __ambiguous
12860 __too_low_aQual
12861 __not_aligned
12862 __alignment_not_unique