wurmlab / oswitch

Provides access to complex Bioinformatics software (even BioLinux!) in just one command.
76 stars 9 forks source link

Plotting? #16

Closed qmwugbt112 closed 9 years ago

qmwugbt112 commented 9 years ago

I tried running R from biolinux. Neither X11() nor quartz() would open a plotting window. Is there any way round this? I'm currently trying to install X11 on the Mac

plot(1:10,runif(10))

no plot produced

X11() Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize, : unable to start device X11cairo In addition: Warning message: In X11() : unable to open connection to X11 display '' quartz() Warning message: In quartz() : Quartz device is not available on this platform

yeban commented 9 years ago

Haven't tested / worked on display functionality from docker containers yet.

qmwugbt112 commented 9 years ago

FYI I've installed X11 and got it working from R running on OS X, but in this case miracles don't happen - it does not work from R in biolinux.

yeban commented 9 years ago

I would have been surprised if opening a window on host "just worked" from docker container.

Something like this could work: docker run -it -v $DISPLAY:$DISPLAY -e DISPLAY=$DISPLAY <image>

yannickwurm commented 9 years ago

Needs to show elegant error message if X is impossible (because X11 not installed or doesn't accept export - with link to proper instructions)

bmpvieira commented 9 years ago

Relevant (GUIs section): https://blog.jessfraz.com/posts/docker-containers-on-the-desktop.html

yannickwurm commented 9 years ago

This is a "generic" issue for docker - thus I feel (hope) that docker will improve to overcome this. So we should not be investing energy redundantly.

Furthermore, there are additional challenges (e.g. will it work on your local X if you're using docker on a machine on the cluster?).

Finally, things like R can output to pdf rather than to X. pdf("output.pdf"); plot(1:10, 1:10); dev.off() - many of us already prefer this way of using R....

Thus I'm closing this issue for now.

bmpvieira commented 9 years ago

Just for future reference, one possible solution would be ssh with X forward. Here's an example of Dockerfile with X forward working: https://github.com/bmpvieira/Dockerfiles/tree/master/seqgrapher