Is there any available code for DeSeq2 method in R?
1
0
Entering edit mode
3.6 years ago
Chaimaa ▴ 260

Hi guys,

Is there any available code for DeSeq2 method in R here, please share it with me if that possible?

I want to reproduce the code to extract the differentially expressed genes (DEG) for a sequence of cancer stages.

Appreciate any help!

R DeSeq2 • 2.6k views
ADD COMMENT
1
Entering edit mode

Just FYI, you can type the name of any function (not followed by parathenses) into the console, and that would give you the code of the function.

However, the first place to look at is probably the documentation, and not the code...

ADD REPLY
1
Entering edit mode

Oh yes, that distinction was not made. Do you want the actual code for the DESeq2 functions of just a tutorial for how to use the package?

As per Sam:

require(DESeq2)
DESeq

function (object, test = c("Wald", "LRT"), fitType = c("parametric", 
    "local", "mean"), sfType = c("ratio", "poscounts", "iterate"), 
    betaPrior, full = design(object), reduced, quiet = FALSE, 
    minReplicatesForReplace = 7, modelMatrixType, useT = FALSE, 
    minmu = 0.5, parallel = FALSE, BPPARAM = bpparam()) 
{
    stopifnot(is(object, "DESeqDataSet"))
    test <- match.arg(test, choices = c("Wald", "LRT"))
    fitType <- match.arg(fitType, choices = c("parametric", "local", 
        "mean"))
...
...
}
<bytecode: 0x22b69e00>
<environment: namespace:DESeq2>
ADD REPLY
0
Entering edit mode

@Hi kevin, yes i need to understand how to use the package, i already read some papers about this method, this method can be used to do normalization and differential epression analysis with an adjusted p value and log2 FC , and that i wonder if there is any Desq2 code available here or any GitHub code for that .

right now i have found this:

 dds <- DESeqDataSetFromMatrix(countData = all,
   colData=annot,  design= ~ Genotype + Age + Batch)
dds <- DESeq(dds)
res_test <- results(dds, contrast = c('Genotype', 'P2mut', 'P2wt'))
res_test <- lfcShrink(dds, contrast = c('Genotype', 'P2mut', 'P2wt'),
  res = res_test, type = 'normal')




 dds <- DESeqDataSetFromMatrix(countData = cts,
                                  colData = coldata,
                                  design= ~ batch + condition)
        dds <- DESeq(dds)
        resultsNames(dds) # lists the coefficients
        res <- results(dds, name="condition_trt_vs_untrt")
        # or to shrink log fold changes association with condition:
        res <- lfcShrink(dds, coef="condition_trt_vs_untrt", type="apeglm")
ADD REPLY
1
Entering edit mode

This is what you need: https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html Please go through it extensively.

ADD REPLY
1
Entering edit mode

True. I would recommend though (if you really want to look at the source code) to check the repo at GitHub https://github.com/mikelove/DESeq2 or download the tarball from Bioconductor https://bioconductor.org/packages/release/bioc/html/DESeq2.html (bottom of the page) since this shows the commented code with proper spacing as written by the author. The compiled functions (e.g. when tyiing DESeq into R console) have comments (#) and blank lines removed, therefore often difficult to read. You will also need to go back and forth between scripts since functions may import subfunctions from other source scripts. Not sure if reading the source code rather than the documentation helps that much in understanding what functions do, unless you are really interested in every nitty gritty under the hood.

ADD REPLY
2
Entering edit mode
3.6 years ago

You can either type vignette("DESeq2") into your R terminal if DESeq2 is installed, or look at their online vignette here.

ADD COMMENT
0
Entering edit mode

@rpolicastro Thank you too much, i wonder if there is also DESeq2 Rscript here on biostars it wi be more helpful to understand how to deal with the possible parameters, given that my data is list of genes as rows and list of samples as columns

ADD REPLY
1
Entering edit mode

Their documentation has an example of using a count matrix like yours as input. You can read more here.

ADD REPLY
1
Entering edit mode

Hey Chaimaa, great to see you again and trust that you are okay. Please see the example shared by rpolicastro,

ADD REPLY
1
Entering edit mode

@Kevin Blighe ,hi Kevin, happy to see you too!, yes I am okay now, you know with Corona we have lost a lot of people, and now i have to return to my research, how are you doing?, hope everything is going great with you? and thank you for your willing always to reply and support, really appreciate that!

ADD REPLY
0
Entering edit mode

@ rpolicastro,Thank you too much, iIm cheking it now .

ADD REPLY

Login before adding your answer.

Traffic: 2673 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6