Commit 49f96bbd authored by San Leon Granado's avatar San Leon Granado
Browse files

Update Figure4_S4.RmD

parent fee2ae63
......@@ -25,7 +25,7 @@ txdb=TxDb.Mmusculus.UCSC.mm10.knownGene
```
# Load CpG islands, gene annotations, methylation, motif positions and Zbtb24 ChIP-seq data
```{r loadTracks}
......@@ -51,21 +51,15 @@ txdb=TxDb.Mmusculus.UCSC.mm10.knownGene
col="black", col.title="black",rot.title=0)
symbols <- unlist(mapIds(org.Mm.eg.db, gene(Gene), "SYMBOL", "ENTREZID", multiVals = "first"))
symbol(Gene) <- symbols[gene(Gene)]
# methylAverage=AnnotationTrack(start=to-200,width=200,chromosome=mychr,
# id=as.character(round(methAverage$V4[index],digits=2)),
# featureAnnotation="id",
# genome="mm10",fontcolor.feature="black",fill="white",
# background.title="transparent",
# col.frame="transparent")
```
```{r}
sizeAxis=0.8
axis=TRUE
#par(mfrow=c(4,4),mar=c(3,1,1,1))
#options(Gviz.scheme = "default")
#pdf("tmp/A4.allpeaks.pdf",paper="a4r",family="sans")
for (index in seq(1,40)){
print(index)
......@@ -252,7 +246,7 @@ for (index in seq(1,40)){
col.frame="transparent", col.axis="black",
col.title="black")
#pdf(paste("peak",index,"pdf",sep="."))
pdf(paste("peak",index,"pdf",sep="."))
errorH3K4=tryCatch({
......@@ -296,64 +290,14 @@ pdf(paste0("tmpFinal/peak",index,".pdf"),width=8,height=8,family="sans")
dev.off()
}
#dev.off()
```
```{r trackViewer}
library(trackViewer)
H3K4me3 <- importScore("H3K4me3.serum.bw",ranges=gr,format="BigWig")
H3K27me3 <- importScore("H3K27me3.serum.bw",ranges=gr,format="BigWig")
POL2 <-importScore("POL2.BRUCE.ENCODE.bigwig",ranges=gr,format="BigWig")
trs <- geneModelFromTxdb(TxDb.Mmusculus.UCSC.mm10.knownGene,
org.Mm.eg.db,
gr=gr)
H3K4me3$dat <- coverageGR(H3K4me3$dat)
H3K27me3$dat <- coverageGR(H3K27me3$dat)
POL2$dat <- coverageGR(POL2$dat)
viewerStyle <- trackViewerStyle()
setTrackViewerStyleParam(viewerStyle, "margin", c(.1, .05, .02, .02))
vp <- viewTracks(trackList(trs,H3K4me3, H3K27me3, POL2),
gr=gr, viewerStyle=viewerStyle,
autoOptimizeStyle=TRUE,smooth=TRUE)
dev.off()
```
```{r correlation}
library(ggpubr)
library(pheatmap)
negatives=read.table("correlationMethylation/CorrelationCdca7_Zbtb24.negatives.bed",sep="\t")
negatives=negatives[negatives$V4< -5 | negatives$V8< -5, ]
positives=read.table("correlationMethylation/CorrelationCdca7_Zbtb24.positives.bed",sep="\t")
positives=positives[positives$V4>5 | positives$V8>5, ]
pheatmap(log2(abs(negatives[,c(4,8)])),cluster_rows = FALSE,cluster_cols = FALSE)
negatives$Zbtb24=log2(abs(negatives$V4))
negatives$Cdca7=log2(abs(negatives$V7))
ggscatter(negatives,x="Zbtb24",y="Cdca7",add="reg.line",add.params = list(color="blue",fill="lightgray",conf.int=TRUE))+
stat_cor(method="pearson",label.x=3,label.y=40)
positives$Zbtb24=log2(abs(positives$V4))
positives$Cdca7=log2(abs(positives$V7))
ggscatter(positives,x="Zbtb24",y="Cdca7",add="reg.line",add.params = list(color="blue",fill="lightgray",conf.int=TRUE))+
stat_cor(method="pearson",label.x=3,label.y=30)
```
# Figure with some examples
```{r}
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment