# Comparing expression of DEG gene in samples

**URL:** <https://help.galaxyproject.org/t/comparing-expression-of-deg-gene-in-samples/8044>\
**Category:** Uncategorized\
**Tags:** transcriptomics, edger, limma\_voom\
**Created:** [May 16, 2022, 4:50am UTC](https://help.galaxyproject.org/t/comparing-expression-of-deg-gene-in-samples/8044 "2022-05-16T04:50:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maryam.klntri.2695](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@maryam.klntri.2695](https://help.galaxyproject.org/u/maryam.klntri.2695)\
**Post date:** [May 16, 2022, 4:50am UTC](https://help.galaxyproject.org/t/comparing-expression-of-deg-gene-in-samples/8044/1 "2022-05-16T04:50:52Z")

</div>

Hi, I got the DEG table with the limma package in R, I searched for the SNAI1 gene in the DEG table and now I want to compare my gene expression in the samples. I want to know in which samples SNAI1 is up-regulated and in which samples it is reduced. How can I do that? With what code? Does anyone know about this ? Thanks in advance

```
   library(limma)
    library(edgeR) 
    dge <- DGEList(rawdata)
    keep <- filterByExpr(dge, design = design)
    keep2 <- data.frame(keep)
    filt <- dge[keep, ,keep.lib.size = F]
    norm <- calcNormFactors(filt, method = "TMM")
    v <- voom(norm, design = design, plot = T)
    E <- v$E
    ex <- 2^E
    Ex <- log2(ex + 1) 

    fit <- lmFit(Ex, design = design)
    contrast <- makeContrasts(cancer-normal, levels = design)
    fit2 <- contrasts.fit(fit = fit,contrasts = contrast)
    fit2 <- eBayes(fit = fit2)
    diff <- topTable(fit = fit2, number = Inf, sort.by = "P" )
```

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [May 18, 2022, 8:25pm UTC](https://help.galaxyproject.org/t/comparing-expression-of-deg-gene-in-samples/8044/2 "2022-05-18T20:25:30Z")

</div>

Hi @maryam.klntri.2695

This forum is for help using the UseGalaxy.\* resources: [Galaxy Platform Directory: Servers, Clouds, and Deployable Resources - Galaxy Community Hub](https://galaxyproject.org/use)

For help with Bioconductor packages command-line, see the package vignettes here [http://bioconductor.org/](http://bioconductor.org/) and their support forum here [Bioconductor - Help](http://bioconductor.org/help/).

If you want to try in Galaxy instead, or want to review those resources for general analysis guidelines/examples, see: [Galaxy Training!](https://training.galaxyproject.org/training-material/topics/transcriptomics/)

Thanks!

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [May 18, 2022, 8:27pm UTC](https://help.galaxyproject.org/t/comparing-expression-of-deg-gene-in-samples/8044/3 "2022-05-18T20:27:06Z")

</div>

Closed on May 18, 2022, 8:27pm UTC


