Gviz group labels overlap
Entering edit mode
8 weeks ago
Katarina ▴ 10


I am trying to plot some SNPs (variants) in a genomic range with Gviz but the labels overlap and I can't figure out where the problem is. They are close by but the ranges themselves do not overlap but their labels do. I want them to be one under the other. I have tried various parameter values for stacking in AnnotationTrack but it doesn't help. Here is a code snippet:

strack <- AnnotationTrack(current_SNPs, name="GWAS SNPs", 
                          group=current_SNPs$SNPS, groupAnnotation="group",
                          fill=Purple, col=Purple)

grbtrack <- AnnotationTrack(current_GRB, name="GRB human:dog", 
                            id=current_GRB$targets, fontcolor.feature="black", 
                            fill=Grey, col=Grey)
displayPars(grbtrack) <- list(featureAnnotation="id")

plotTracks(list(grbtrack, strack),
           sizes = c(1,1),
           background.title="azure3", fontcolor.title="black")

The two granges objects:

> current_GRB
GRanges object with 1 range and 7 metadata columns:
      seqnames              ranges strand |   ENSEMBLGeneID    geneName originalSupport
         <Rle>           <IRanges>  <Rle> |     <character> <character>     <character>
  [1]     chr1 213297131-215179503      * | ENSG00000117707       PROX1           0.876
      normalisedSupport  prediction   ucscCoordinates.hg19     targets
            <character> <character>            <character> <character>
  [1]                 1      target chr1:214156524-21421..       PROX1

> current_SNPs
GRanges object with 2 ranges and 2 metadata columns:
      seqnames              ranges strand |        SNPS            SNP.coords
         <Rle>           <IRanges>  <Rle> | <character>           <character>
  [1]     chr1           213937382      * |   rs1891058                  <NA>
  [2]     chr1 213944467-213944489      * | rs147340715 1:213944467-213944489


gviz ploting AnnotationTrack • 173 views
Entering edit mode
8 weeks ago
Trivas ▴ 590

Doesn't look like there's great customization options in the Gviz documentation. Your best bet might be to zoom in on the SNPs in PROX1 to make them bigger.

Arranging items on the plotting canvas is relatively straight forward as long as there are no overlaps between individual regions or groups of regions. Those inevitably cause overplotting which could seriously obfuscate the information on the plot. A logical solution to this problem is to stack overlapping items in separate horizontal lines to accommodate all of them. This involves some optimization, and the Gviz package automatically tries to come up with the most compact arrangement.

Entering edit mode

Its a bit of a bigger region than a gene, so that is why its so small. Thanks for the answer. Though, I was bothered by it because in this track, where there are more ranges, Gviz stacks them pretty nicely.

enter image description here


Login before adding your answer.

Traffic: 2351 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6