Entering edit mode
stephen.williams
▴
10
@stephenwilliams-15198
Last seen 6.4 years ago
I'm trying to make a Composite plot of multiple gene regions. I've read the vignette, Chapter 6 on doing this. I'm able to plot my data but not the GeneRegionTrack using.
chroms <- c("chr2", "chr17")
ncols <- 1
nrows <- length(chroms)%/%ncols
grid.newpage()
pushViewport(viewport(layout = grid.layout(nrows,ncols)))
for (i in seq_along(chroms)) {
pushViewport(viewport(layout.pos.col = ((i -1)%%ncols) + 1, layout.pos.row = (((i) -1)%/%ncols) + 1))
plotTracks(list(mdTrack),chromosome = chroms[i], type= "histogram", showId = TRUE, stacking = "dense", lty.grid="dashed", add = TRUE)
popViewport(1)
}
Is there a way to have multiple genes regions stored in in a single object? Right now I'm using the BiomartGeneRegionTrack
to pull my gene region data
geneTrack <-BiomartGeneRegionTrack(genome = "hg38",
symbol = c("DNMT3A","RAI1"),
cex = 2,
fontsize = 15,
stacking = "squish",
name = "Ensembl Genes v92",
background.title = "grey",
biomart=biomaRt::useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl"))
However, this only stores the last gene. In this case RAI1
Is it possible to plot two (or more) gene regions at the same time?
For anyone interested I got this to work by ultimately plotting my tracks as per below. This method should be able to take any number of tracks and combine as many loci as you'd like.