if(require(BSgenome.Hsapiens.UCSC.hg18) && require(grid)){
si <- seqinfo(BSgenome.Hsapiens.UCSC.hg18)
iparam <- IdiogramParams(seqnames="chr1",
genome="hg18",
seqlengths=seqlengths(si)["chr1"],
box=list(xlim=c(20e6L, 25e6L), color="blue", lwd=2))
iparam
idiogram <- plot(iparam)
vp <- viewport(x=0.05, y=0.8, width=unit(0.9, "npc"), height=unit(0.2, "npc"),
name="vp1", just=c("left", "bottom"))
grid.newpage()
pushViewport(vp)
print(idiogram, vp=vp, newpage=FALSE)
}
Run the code above in your browser using DataLab