-
Notifications
You must be signed in to change notification settings - Fork 0
/
RNAseq-DESeq2.R
26 lines (24 loc) · 1.2 KB
/
RNAseq-DESeq2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(DESeq2)
library(dplyr)
library(org.OOryza.eg.db)
library(clusterProfiler)
options(stringsAsFactors=F)
a<-read.table("all.featureCount.res",h=T)
condition<-rep(c("HS","NORMAL"),each=3)
coldata<-data.frame(condition=condition)
dds <- DESeqDataSetFromMatrix(countData = data, colData = coldata,design= ~ condition)
dds <- DESeq(dds)
vsd <- vst(dds, blind=FALSE)
resA_B<-results(dds,alpha=0.05)
H_up <- data.frame(gene=rownames(resA_B),resA_B) %>% filter(log2FoldChange< -1,padj<0.01) %>% mutate(Nip= gsub("\\..+","",gene)) %>% left_join(alllist,by="Nip") %>% na.omit()
H_up.res = enrichGO(H_up$ENTREZID, OrgDb=rice, pvalueCutoff=1, qvalueCutoff=1,pAdjustMethod="none",ont="BP")
pdf("H_up.GO.pdf",12,7)
dotplot(H_up.res)
dev.off()
write.csv(H_up.res@result,"H_up.GO.csv",row.names=F)
H_down <- data.frame(gene=rownames(resA_B),resA_B) %>% filter(log2FoldChange > 1,padj<0.01) %>% mutate(Nip= gsub("\\..+","",gene)) %>% left_join(alllist,by="Nip") %>% na.omit()
H_down.res = enrichGO(H_down$ENTREZID, OrgDb=rice, pvalueCutoff=1, qvalueCutoff=1,pAdjustMethod="none",ont="BP")
pdf("H_down.GO.pdf",12,7)
dotplot(H_down.res)
dev.off()
write.csv(H_down.res@result,"H_down.GO.csv",row.names=F)