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
Thanks a lot for this wonderful tool, but I think there's an issue with the plotMultiSignal() function, especially with the range argument. I want to plot multiple signals but in two separate sections of the graph, for example -
In this example I wish to set the scale for both the plots from the human genome and the chimp genome to c(0,250), although it seems to work for the upper plot the second plot still gets scaled based on the optimising code. Upon inspection of the source code for the function you can find here -
The range is set by the function irrespective of whether the range parameter was passed explicitly during call. So the range is always determined by the code and not by the user. I'm also not sure if the range param is processed and stored in the multisigInternal object that is created in this step -
If indeed the argument is saved in the multisigInternal object, a simple fix could be something like
if (is.null(multisigInternal$range)) {
range <- calcSignalRange(data = signal,
chrom = multisigInternal$chrom,
chromstart = multisigInternal$chromstart,
chromend = multisigInternal$chromend,
assembly = multisigInternal$assembly,
negData = multisigInternal$negData)
} else {
range <- multisigInternal$range
}
where we can simply add a check to see if range=NULL which is the default value or it contains a user input and process the rest of the code as usual. Please let me know if this can fixed, or if I'm completely misreading the usage and doing something wrong.
Here's the section of my script where I call the plotMultiSignal() function -
## Plot multiple signals
multisignal <- plotMultiSignal(sp1_signalList, chrom = sp1$chr1[i],
chromstart = min(sp1[i,c("x1","x2","y1","y2")]) - pad_flank,
chromend = max(sp1[i,c("x1","x2","y1","y2")]) + pad_flank,
linecolor = c(rep(c("black"),2)),
range = c(0,250), scale = TRUE,
label = c("Sample A", "Sample B"),
assembly = sp1_id, x = 2.5, y = 3.5,
width = 4.62, height = 1.5, default.units = "inches",
gapdistance = 0.05, just = c("center", "top"))
## Label Plot
plotText(paste0(sp1_id," Genome"), fontsize = 12, x = 2.5, y = 5.225, just = "center", fontface = "italic")
plotSegments(0, 5.4, 5, 5.4, lwd = 2, lty = 2)
# Plots for loops in second species
## Label Plot
plotText(paste0(sp2_id," Genome"), fontsize = 12, x = 2.5, y = 5.575, just = "center", fontface = "italic")
## Plot multiple signals
multisignal <- plotMultiSignal(sp2_signalList, chrom = sp2$chr1[i],
chromstart = min(sp2[i,c("x1","x2","y1","y2")]) - pad_flank,
chromend = max(sp2[i,c("x1","x2","y1","y2")]) + pad_flank,
linecolor = c(rep(c("red"),2)),
range = c(0,250), scale = TRUE,
label = c("Sample C", "Sample D"),
assembly = sp2_id, x = 2.5, y = 5.65,
width = 4.62, height = 1.5, default.units = "inches",
gapdistance = 0.05, just = c("center", "top"))
Thanks a lot for this wonderful tool, but I think there's an issue with the plotMultiSignal() function, especially with the
range
argument. I want to plot multiple signals but in two separate sections of the graph, for example -In this example I wish to set the scale for both the plots from the human genome and the chimp genome to
c(0,250)
, although it seems to work for the upper plot the second plot still gets scaled based on the optimising code. Upon inspection of the source code for the function you can find here -plotgardener/R/plotMultiSignal.R
Line 331 in 4471ff0
The range is set by the function irrespective of whether the
range
parameter was passed explicitly during call. So the range is always determined by the code and not by the user. I'm also not sure if therange
param is processed and stored in themultisigInternal
object that is created in this step -plotgardener/R/plotMultiSignal.R
Line 276 in 4471ff0
If indeed the argument is saved in the
multisigInternal
object, a simple fix could be something likewhere we can simply add a check to see if
range=NULL
which is the default value or it contains a user input and process the rest of the code as usual. Please let me know if this can fixed, or if I'm completely misreading the usage and doing something wrong.Here's the section of my script where I call the
plotMultiSignal()
function -Here's my session info -
The text was updated successfully, but these errors were encountered: