0

I'm using the pakage circlize to draw histograms of two different bed (dataframes). I could do the histograms in two diffrerent tracks using the "circos.trackHist" function, but I cant compare them because they have different scales in the Y axis. This function has a parameter to force the scales between the cells of the same track (force.ylim=TRUE), but I couldn't found a way to force the Y scales between tracks.

Is this possible?

1 Answers1

0

Well... I found this solution.

To mantain the same Y scale between the cells of a particular track, you have to add the parameter "force.ylim = TRUE", inside the function "circos.trackHist". For example:

circos.trackHist(sexpoints2$CHROMOSOME, sexpoints2$START, track.height = 0.1, col = "blue", border = NA, bin.size = 1000000, force.ylim=TRUE)

This, automaticaly calculates the range of the y axis. But if you need to force a determined range of y axis in the entire track, you can defined it following these steps:

1- Edit the "circos.trackHist" function by:

trace(circos.trackHist, edit = TRUE)

2- Serch inside the new windows the function "circos.trackPlotRegion" and define the new range of y axis by the parameter "ylim =" For example:

circos.trackPlotRegion(factors = fa, y = yy, track.height = track.height, 
    track.index = track.index, force.ylim = force.ylim, bg.col = bg.col, 
    bg.border = bg.border, bg.lty = bg.lty, bg.lwd = bg.lwd, 
    ylim = c(0, 15))

3- Save the edit, and run the function "circos.trackHist".

This is usefull to compare histogram tracks made of different data.

Enjoy.