Question: Gviz: Placement of chromosome name in IdeogramTrack?
0
gravatar for stianlagstad
3.1 years ago by
stianlagstad90
stianlagstad90 wrote:

Can I set the position of the name of the chromosome when using an IdeogramTrack?

This code:

transcriptID <- "ENST00000421310"
chromosome <- "chr6"
genome = "hg19"

mart <- biomaRt::useMart(
  biomart = "ENSEMBL_MART_ENSEMBL",
  dataset = "hsapiens_gene_ensembl",
  host = "dec2013.archive.ensembl.org")

# Create transcript track
biomartTrack <- Gviz::BiomartGeneRegionTrack(
  filters = list(
    ensembl_transcript_id = transcriptID),
  biomart = mart)
biomartTrack <- as(biomartTrack, "GeneRegionTrack")
# Set display paramters
Gviz::displayPars(biomartTrack) <- list(
  showId = TRUE,
  showTitle = FALSE,
  just.group = "above",
  cex.group = 2,
  fontcolor.group = "black"
)

# Create ideogram track
idTrack <- Gviz::IdeogramTrack(
  genome = genome,
  chromosome = chromosome)
# Set display paramters
Gviz::displayPars(idTrack) <- list(
  showId = TRUE,
  fontcolor = "black",
  fontsize = 25,
  just.group = "above")

# Plot!
Gviz::plotTracks(
  c(idTrack, biomartTrack),
  from = biomartTrack@start,
  to = biomartTrack@end,
  chromosome = chromosome)

Produces this plot:

  • I would like the name of the chromosome to be placed above the chromosome, like the transcript name is placed above the transcript. just.group has no effect when used with the IdeogramTrack.
  • I would also like it to have the same font size, which I haven't been able to do as the IdeogramTrack uses fontsize while the¬†GeneRegionTrack uses cex.group.

Is it possible to make the chromosome and transcript names appear in the same fashion?

gviz • 834 views
ADD COMMENTlink modified 3.0 years ago by florian.hahne@novartis.com1.6k • written 3.1 years ago by stianlagstad90
Answer: Gviz: Placement of chromosome name in IdeogramTrack?
0
gravatar for florian.hahne@novartis.com
3.0 years ago by
Switzerland

You should be able to also use fontsize for the BiomartGeneRegionTrack. This is a parameter of the base track class, and should be recognized everywhere. So I guess that in order to get the two fonts to the same size, you will need to set cex.group to 1, and only change fontsize for both tracks.

Florian

ADD COMMENTlink written 3.0 years ago by florian.hahne@novartis.com1.6k
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 16.09
Traffic: 339 users visited in the last hour