-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChIPseeker.R
48 lines (43 loc) · 1.57 KB
/
ChIPseeker.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
library(clusterProfiler)
library(enrichplot)
library(ggplot2)
library(org.Hs.eg.db)
setwd("TCGA-BRCA/")
xxt<-read.table("selectmrna43_fc")
head(xxt)
genelist<-as.numeric(xxt[,3])
names(genelist) = as.character(rownames(xxt))
genelist = sort(genelist, decreasing = TRUE)
gse <- gseGO(geneList=genelist,
ont ="BP",
keyType = "ENSEMBL",
minGSSize = 3,
pvalueCutoff = 0.05,
verbose = TRUE,
OrgDb = org.Hs.eg.db,
pAdjustMethod = "none")
y<-as.data.frame(x)
p<-ggplot(y[c(3,5,6,9,18,20,26,33),],
aes(x = GeneRatio, y = Description)) +
geom_point(aes(size = GeneRatio, color = p.adjust)) +
theme_bw(base_size = 14) +
scale_colour_gradient(limits=c(0, 0.10), low="red") +
ylab(NULL)
library(ChIPseeker)
library(GSEABase)
file <- "biomartpeaks"
gr <- readPeakFile(file)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
TxDb <- TxDb.Hsapiens.UCSC.hg19.knownGene
genes <- seq2gene(gr,
tssRegion = c(-1000,1000),
flankDistance = 3000,
TxDb) //nice TxDb, file<-sys.arg[]
403 genes were dropped because they have exons located on both strands of the same
reference sequence or on more than one reference sequence, so cannot be
represented by a single genomic range.
Use 'single.strand.genes.only=FALSE' to get all the genes in a GRangesList object,
or use suppressMessages() to suppress this message. //so it's fine to drop genes
g <- bitr(genes,
"ENTREZID",
"SYMBOL",