1

HI I'm using the Gviz package to add a gene track from UCSC. I can change most things, however I'm wondering if I can change the size of the arrow head? Currently its way too small and I need to augment it a bit.

rTrack <- UcscTrack(genome=gen, chromosome=chrom, track="NCBI RefSeq", 
                    from=minbase, to=maxbase, trackType="GeneRegionTrack", 
                    rstarts="exonStarts", rends="exonEnds", gene="name", 
                    symbol="name2", transcript="name", strand="strand", 
                    fill="darkblue",stacking="squish", name="RefSeq", cex.title=2.8,
                    cex.axis=1.1, cex = 3, lwd = 2.5, # 
                    showId=TRUE, geneSymbol=TRUE)

displayPars(rTrack) <- list(fontsize = 15) # changes title 
displayPars(rTrack) <- list(cex.group = 1.7) #  changes gene name 
#displayPars(rTrack) <- list(arrowHeadMaxWidth=30, arrowHeadWidth=30, shape="arrow") #  only changes the grey box
displayPars(rTrack) <- list(col.line = '#6e706b' ) # 

this is what it looks like, however I arrow head is way too small.

enter image description here

Ahdee
  • 4,679
  • 4
  • 34
  • 58
  • You should be able to see all of the modifiable options with `head(displayPars(rTrack))`. It looks like there are two options related to the arrows: `arrowHeadWidth` and `arrowHeadMaxWidth`. If this doesn't work, it may be best to provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Kat Dec 14 '21 at 23:16
  • @Kat thanks I did try that however all it did was make that blue box into an arrow. I don't know how to create a reproducible example since the track requires a large amount of data to be imported before it can render this. – Ahdee Dec 14 '21 at 23:38

1 Answers1

1

This works, but it's not really an answer. I thought I had figured it out, but I definitely have not.

This is using your code, but with example data through the `Gviz package.

I changed the col.line to "darkred" and the cex.group = 1 but I don't think either is relative. The difference was finally seen when I made the plot pan really short and then re-plotted. This is 744 x 239.

enter image description here

Then I dragged the plot pan up (made it taller). I did not re-plot this. If you replot it makes the arrows tiny. Without re-plotting, this is what I get (for 744 x 1030)

enter image description here

This was really discovered on accident. I hope it can help. (I know it's a lame non-answer, but sometimes what works is enough.)

Kat
  • 15,669
  • 3
  • 18
  • 51
  • thanks so much for trying. Its strange how there is no way into this. I also looked into the various annotations, and like you, I also thought I found it. Your method won't work for me since I also stack these on top of other tracks that gets stretch out. For now I'm just going to export this to pdf and increase it with good old adobe. – Ahdee Dec 15 '21 at 22:53