trackViewer font
1
0
Entering edit mode
@liruiradiant-8906
Last seen 2.9 years ago
United States

Hello Jianhong,

I was using trackViewer to generate plotting for ChIPSeq data. In the end result, the font on the labeling for each track seem too big, e.g. 'genes', 'H1', 'H2'. I can change these after exporting to PDF and edit by AI. But, is there a way to change font size in R code?

Thanks!

enter image description here


optSty <- optimizeStyle(trackList(HA1, HA2, genes), theme="safe")
trackList <- optSty$tracks
viewerStyle <- optSty$style

setTrackViewerStyleParam(viewerStyle, "margin", c(.05, .2, .05, .05)) #bottom, left, top and right margin.
setTrackXscaleParam(trackList[[2]], "draw", TRUE)
setTrackXscaleParam(trackList[[2]], "gp", list(cex=0.8))
# setTrackXscaleParam(trackList[[2]], attr="position", 
#                     value=list(x=69035856, y=2, label=1000))
setTrackViewerStyleParam(viewerStyle, "xaxis", FALSE) # disable x ticks
setTrackStyleParam(trackList[[1]], "ylim", c(0, 0.5))
setTrackStyleParam(trackList[[2]], "ylim", c(0, 0.5))



vp <- viewTracks(trackList, 
                 gr=gr, viewerStyle=viewerStyle, 
                 autoOptimizeStyle=TRUE)

addGuideLine(c(69035856, 69037005), vp=vp) #peak1
addArrowMark(list(x=(69035856 + 69037005)/2,
                  y=2), # 2 means track 2 from the bottom.
             label="peak",
             col="darkgreen",
             vp=vp)
trackViewer • 1.3k views
ADD COMMENT
0
Entering edit mode
Ou, Jianhong ★ 1.3k
@ou-jianhong-4539
Last seen 18 days ago
United States

Hi,

Try

## set cex to avoid automatic adjust
setTrackStyleParam(trackList[[1]], "ylabgp", list(cex=.6))

Let me know if you still have issues in changing that.

Jianhong.

ADD COMMENT
0
Entering edit mode

Thanks! This adjustment works very well

ADD REPLY

Login before adding your answer.

Traffic: 373 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