Search
Question: Gviz: Multiple BiomartGeneRegionTrack one object for Composite plots
0
gravatar for stephen.williams
4 weeks ago by
stephen.williams10 wrote:

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?

ADD COMMENTlink modified 4 weeks ago • written 4 weeks ago by stephen.williams10

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.

grid.newpage()
pushViewport(viewport(layout = grid.layout(2,1)))

pushViewport(viewport(layout.pos.col = ((1 -1)%%1) + 1, layout.pos.row = (((1) -1)%/%1) + 1))
    plotTracks(list(rai1_gtrack, rai1_ht), type= "histogram", showId = TRUE, stacking = "dense", lty.grid="dashed", add = TRUE, fontsize = 13, title.width=1)
popViewport(1)

pushViewport(viewport(layout.pos.col = ((2 -1)%%1) + 1, layout.pos.row = (((2) -1)%/%1) + 1))
    plotTracks(list(dnmt3a_gtrack, dnmt3a_ht), type= "histogram", showId = TRUE, stacking = "dense", lty.grid="dashed", add = TRUE, reverseStrand=TRUE, fontsize = 13, title.width=1)
popViewport(1)
ADD REPLYlink written 4 weeks ago by stephen.williams10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 255 users visited in the last hour