jianhong / ChIPpeakAnno

11 stars 4 forks source link

makeVennDiagram produces undesired console output #35

Closed drighelli closed 8 months ago

drighelli commented 8 months ago

Hi,

I'm using the makeVennDiagram function as in the following code, but together with the plot, it prints lots of output in console.

This is not ideal because it makes it difficult to read the output when including the function in a rmakrdown.

Is there a sort of verbose argument to remove this annoying output?

mol <- findOverlapsOfPeaks(gr1, gr2)
makeVennDiagram(mol, NameOfPeaks=names(mrrplist), by="region",
    fill=c(colors[2], colors[7]), # circle fill color
    col=c(colors[4], colors[3]), #circle border color
    cat.col=c(colors[4], colors[3]))

This is a screenshot of the output:

Screenshot 2023-11-07 at 11 02 18

Thanks, Dario

jianhong commented 8 months ago

This message is from upstream package. Could you please try suppressMessage or {r messages=FALSE, warnings=FALSE}

drighelli commented 8 months ago

Thanks, but both solutions don't work, I think it's a log print to console from the venn.diagram function.

I think you can easily disable, or manage it, by setting the disable.logging=TRUE

venn.diagram(x, filename, disable.logging = FALSE, height = 3000, 
    width = 3000, resolution = 500, imagetype = "tiff", 
    units = "px", compression = "lzw", na = "stop", main = NULL, 
    sub = NULL, main.pos = c(0.5, 1.05), main.fontface = "plain",
    main.fontfamily = "serif", main.col = "black",
    main.cex = 1, main.just = c(0.5, 1), sub.pos = c(0.5,
    1.05), sub.fontface = "plain", sub.fontfamily =
    "serif", sub.col = "black", sub.cex = 1, sub.just =
    c(0.5, 1), category.names = names(x), force.unique =
    TRUE, print.mode = "raw", sigdigs = 3, direct.area =
    FALSE, area.vector = 0, hyper.test = FALSE, total.population = NULL, 
    lower.tail = TRUE, ...)
...
disable.logging
Boolean to disable log file output and print to console instead
...
hukai916 commented 8 months ago

Hi @drighelli, we will test the disable.logging = TRUE option soon. Meanwhile, you can set {r, results = "hide"} in your R markdown code chunk to hide the logging info.

jianhong commented 8 months ago

That will create a local log file without permission which is forbidden in Bioconductor package. I will consider to output the parameter.

drighelli commented 8 months ago

oh yeah, you're right, yep I think using a parameter would be the best solution.

Thanks!

drighelli commented 8 months ago

Thanks @hukai916, I didn't see your answer before! It worked! @jianhong you can close this issue for me!