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

Delete run_deseq.R

parent f7f43b06
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*(res$log2FoldChange)
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)
########################" poUR ALLER CHERHCERH DES TRUC INTERESSANT
## simulation functions
source("mydatalocal/counts_simulation/src/simulators.R")
var(rnbinom(10000, mu=1000, size=200))
N_gene= 6000
N_cond= 2
N_rep= 2
mtrx<-matrix_generator(1000, 2)
cond <- factor(rep(1:2, each=N_rep))
dds <- DESeqDataSetFromMatrix(cnts, DataFrame(cond), ~ cond)
# standard analysis
dds <- DESeq(dds, fitType='local')
res <- results(dds)
mcols(dds,use.names=TRUE)[1:4,]
substr(names(mcols(dds)),1,10)
mcols(mcols(dds), use.names=TRUE)[1:4,]
assays(dds)[["mu"]]
head(assays(dds)[["mu"]][which(res$padj<0.05),])
head(assays(dds)[["mu"]][which(res$padj>0.05),])
dispersions(dds)
assays(dds)[["cooks"]][27,]
sizeFactors(dds)
b =mcols(dds)
assays(dds)[["H"]]
alpha_sample = dispersions(dds)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment