# NOT RUN {
data(chr11ChIPseq)
data(chr11first)
library(ggplot2)
ann.colors <-
c(noPeaks="#f6f4bf",
peakStart="#ffafaf",
peakEnd="#ff4c4c",
peaks="#a445ee")
both <- list(coverage=chr11ChIPseq$coverage, first=chr11first)
representations <- NULL
one.sample <- "McGill0322"
for(data.type in names(both)){
one <- subset(both[[data.type]], sample.id==one.sample)
representations <- rbind(representations, data.frame(data.type, one))
}
one.sample.regions <- subset(
chr11ChIPseq$regions, sample.id==one.sample)
if(interactive() && require(ggplot2)){
ggplot()+
scale_fill_manual("annotation", values=ann.colors,
breaks=names(ann.colors))+
penaltyLearning::geom_tallrect(aes(xmin=chromStart/1e3, xmax=chromEnd/1e3,
fill=annotation),
data=one.sample.regions, alpha=1/2)+
theme_bw()+
theme(panel.margin=grid::unit(0, "cm"))+
facet_grid(data.type ~ ., scales="free")+
geom_step(aes(chromStart/1e3, count), data=representations)+
xlab("position on chr11 (kilo base pairs)")
}
# }
Run the code above in your browser using DataLab