You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some functions currently don't offer the option to plot different datasets by different colors (plotFeatureDist, plotQTHist) and are written in a way that it would be impossible to add that option as another layer to the ggplot object.
The text was updated successfully, but these errors were encountered:
I am interested in this issue. Is there a way to change the colors for plotting on these three functions? plotChromBins plotExpectedPartitions plotPartitions
Hi! The output of the plot function is always ggplot object, so you can always add another layer or change the color setting. I am giving here examples for the three functions you are interested in - for single region set or multiple region sets:
# upload queries
# single query
queryFile = system.file("extdata", "vistaEnhancers.bed.gz", package="GenomicDistributions")
query = rtracklayer::import(queryFile)
# query list
query2 = GenomicRanges::shift(query, 1e6)
queryList = GRangesList(vistaEnhancers=query, shifted=query2)
# 1) single region set - change color to red
# chromosome distribution
chrombins = calcChromBinsRef(query, "hg19")
p = plotChromBins(chrombins)
p$layers[[1]]$aes_params$fill = 'red'
p
# partition overlap
part = calcPartitionsRef(query, "hg19")
p = plotPartitions(part)
p$layers[[1]]$aes_params$fill = 'red'
p
# expected paritions
ePart = calcExpectedPartitionsRef(query, "hg19")
p = plotExpectedPartitions(ePart)
p$layers[[1]]$aes_params$fill = 'red'
p
# 2) multiple region sets - change color to red and blue
chrombins = calcChromBinsRef(queryList, "hg19")
plotChromBins(chrombins) +
scale_fill_manual(values = c("red", "blue")) +
scale_color_manual(values = c("red", "blue"))
# partition overlap
part = calcPartitionsRef(queryList, "hg19")
plotPartitions(part)+
scale_fill_manual(values = c("red", "blue"))
# expected paritions
ePart = calcExpectedPartitionsRef(queryList, "hg19")
plotExpectedPartitions(ePart)+
scale_fill_manual(values = c("red", "blue"))
These examples are applicable to all of the other plotting functions. Hope this helps!
Some functions currently don't offer the option to plot different datasets by different colors (plotFeatureDist, plotQTHist) and are written in a way that it would be impossible to add that option as another layer to the ggplot object.
The text was updated successfully, but these errors were encountered: