Gviz: Placement of chromosome name in IdeogramTrack?
1
0
Entering edit mode
stianlagstad ▴ 90
@stianlagstad-9723
Last seen 4.2 years ago

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 • 1.5k views
ADD COMMENT
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.7 years ago
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 COMMENT

Login before adding your answer.

Traffic: 506 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6