**140**wrote:

HI

How to sum the gene-wise counts in edge R for differential genes comparing 2 groups. Looking for two-group comparison with n=2 in each group. I'm new to R literally struck. suggestion please.

```
The tabulate matrix looks some thing like this
temp Test Sample GeneI Gene2 Gene2 Gene3 ....Genen
t80 T1 1 55
t80 T1 2 89
t80 T1 3 54
t80 T1 4 453
t80 T1 5 50
t80 T1 6 32
t80 T2 7 45
t80 T2 8 45
t80 T2 9 50
t80 T2 10 54
t80 T2 11 45
t80 T2 12 15
t8 T3 13 43
t8 T3 14 25
t8 T3 15 404
t8 T3 16 385
t8 T3 17 51
t8 T3 18 32
t8 T4 19 454
t8 T4 20 395
t8 T4 21 53
t8 T4 22 35
t8 T4 23 96
t8 T4 24 87
Code
library(edgeR)
matrix.dge <- DGEList(matrix)
head(matrix.dge)
sumgenes <- sumTechReps(matrix.dge,ID=colnames(matrix.dge))
head(sumgenes)
sumcounts <- sumgenes$counts
nrow(sumcounts)
head(sumcounts)
tail(sumcounts)
The result seems to be same after applying sumTechReps function
```

**1.7k**• written 7 weeks ago by sunnykevin97 •

**140**