by ddolbae01 » Wed Jun 20, 2018 1:59 pm
I got the read counts using DESeq2.
After installation of DESeq library in R studio, performed the DESeq2 analysis in R.
DESeq2 R code is as follows and I attached the results.
#Efrain Gonzalez
#January 23, 2018
#R code for DESeq2 Analysis Dr. Hooi
library(DESeq2)
##Choose directory with files in it
##set directory before this step
mydirectory <- getwd()
##Grab Treated files
myFiles <- grep("Count",list.files(mydirectory),value=TRUE)
##chop up file name to obtain condition status
#mycondition <- sub("(.*R4).*","\\1",myFiles)
mycondition <- c(rep("OOB",13),rep("YOB",15))
myTable <- data.frame(sampleName = myFiles, fileName = myFiles, condition = mycondition)
##Build DESeqDataSet
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = myTable, directory = mydirectory, design = ~ condition)
ddsHTSeq
##Collapse technical replicates
ddsHTSeq$sample <- factor(c(rep("OOB",13),rep("YOB",15)))
ddsHTSeq$run <- paste0("run",1:28)
##Analysis of Differential Expression for Biological Replicates
DESR <- DESeq(ddsHTSeq)
#R4 VS R5
RES1 <- results(DESR,contrast = c("condition","OOB","YOB"))
RES1ordered <- RES1[order(RES1$pvalue),]
#R1 VS R4
#RES3 <- results(DESR,contrast = c("condition","R1","R4"))
#RES3ordered <- RES3[order(RES3$pvalue),]
write.table(as.data.frame(RES1ordered),sep="\t",col.names = TRUE, row.names= TRUE,file="OOB_vs_YOB_results1.txt")
#write.table(as.data.frame(RES3ordered),sep="\t",col.names = TRUE, row.names= TRUE,file="R1_R4_results.txt")
- Attachments
-
- OOB_vs_YOB_results.txt
- (4.45 MiB) Downloaded 218 times