zwdzwd / sesame

🍪 SEnsible Step-wise Analysis of DNA MEthylation BeadChips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ubuntu 20 R console overcoming font issues and CNV plot constraints

claus-h-g opened this issue · comments

Dear all
For reproducing the example code for CNV plots
on Ubuntu in R-4.3.0 console I ran:

install.packages("devtools", repos="https://cloud.r-project.org/")
install.packages("BiocManager", repos="https://stat.ethz.ch/CRAN/")
BiocManager::install("zwdzwd/sesame")
BiocManager::install("DNAcopy", update= FALSE, ask= FALSE)

<library(sesame)
sesameDataCache()
sdf = sesameDataGet('EPIC.1.SigDF')
segs <- cnSegmentation(sdf)
visualizeSegments(segs)

I did obtain the following error:
Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
X11 font -adobe-helvetica-%s-%s---%d-------*, face 1 at size 11 could not be loaded

Fix: installing non-free fonts for Ubuntu:
sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi
(Reference:https://askubuntu.com/questions/449578/x11-font-adobe-helvetica-s-s-d-face-2-at-size-11-could-no)

With above fix I did obtain the following CNV plot in x-term:
2023-09-15_17-57-34_Sesame_incomplete_copy_number_plot_Screenshot

and on the console the following warning:

“In grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only once per page”

Fix: define a R print device with pdf() command

Commands I ran:

library(sesame)
sesameDataCache()
sdf = sesameDataGet('EPIC.1.SigDF')
segs <- cnSegmentation(sdf)
#define print device
pdf("/home/minknow/cnv_20230925.pdf", height=8, width=17)
visualizeSegments(segs)
dev.off()
null device
1
results in:

coplete_cnv_plotScreenshot_2023-09-25_13-05-22

Hope this helps others using ubuntu and R without R-studio.

Forgot to mention, on this Ubuntu machine there is one user called "minknow". The R-print device redicts the output to a pdf file in the home directory of user minknow.