Skip to content
Snippets Groups Projects
Commit 31beb884 authored by Arnaud Duvermy's avatar Arnaud Duvermy
Browse files

add scr to run deseq2f

parent fb091109
No related branches found
No related tags found
No related merge requests found
library("DESeq2")
directory <- "mydatalocal/counts_simulation/results/"
sampleFiles <- grep("*tsv",list.files(directory),value=TRUE)
sampleName <- sub("*.tsv","",sampleFiles)
sampleName
sampleCondition <- as.character(sampleName)
for (i in 1:length(sampleCondition)){
sampleCondition[i] <- gsub("_[A-B]", "", sampleCondition[i])
}
sampleCondition
sampleTable <- data.frame(sampleName = sampleName,
fileName = sampleFiles,
condition = sampleCondition)
sampleTable
str(sampleTable)
ddsInput <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
directory = directory,
design = ~ condition)
dds <- DESeq(ddsInput)
resultsNames(dds)
resLFC <- lfcShrink(dds, coef=2, type="apeglm")
resLFC
# an alternate analysis: likelihood ratio test
ddsLRT <- DESeq(dds, test="LRT", reduced= ~ 1)
resLRT <- results(ddsLRT)
resLRT
dds$sizeFactor
coef(dds)
coef(dds, SE=TRUE)[1,]
dds <- estimateSizeFactors(dds)
dds$condition
head(counts(dds, normalized=TRUE))
resGA <- results(dds, contrast=c("condition","env1","env2"), lfcThreshold=.4, altHypothesis="greaterAbs")
table(resGA$padj < 0.05)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment