jernst98 / ChromHMM

GNU General Public License v3.0
74 stars 18 forks source link

running ChromHMM LearnModel on a headless node (no X11) #1

Closed avilella closed 7 years ago

avilella commented 7 years ago

Hi,

Is it possible to run ChromHMM LearnModel on a Linux node with no X11?

I am running it like below and get the following error:

java -mx1600M -jar /bi/home/rocks-av/ChromHMM/ChromHMM.jar LearnModel -p 0 -nobrowser /bi/group/cegx/CEGX_Run434/CEGX_Run434-12345678/inputbams/BINARIES /bi/group/cegx/CEGX_Run434/CEGX_Run434-12345678/inputbams/CHROMHMM 2 hg38                                                                                                                                                                                            Using 8 threads for Baum-Welch training
Writing to file /bi/group/cegx/CEGX_Run434/CEGX_Run434-12345678/inputbams/CHROMHMM/transitions_2.txt
Writing to file /bi/group/cegx/CEGX_Run434/CEGX_Run434-12345678/inputbams/CHROMHMM/emissions_2.txt
connect localhost port 6044: Connection refused
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
        at org.tc33.jheatchart.HeatChart.measureComponents(HeatChart.java:1406)
        at org.tc33.jheatchart.HeatChart.getChartImage(HeatChart.java:1301)
        at org.tc33.jheatchart.HeatChart.getChartImage(HeatChart.java:1354)
        at edu.mit.compbio.ChromHMM.Util.printImageToSVG(Util.java:140)
        at edu.mit.compbio.ChromHMM.ChromHMM.printEmissionImage(ChromHMM.java:1215)
        at edu.mit.compbio.ChromHMM.ChromHMM.trainParametersParallel(ChromHMM.java:4817)
        at edu.mit.compbio.ChromHMM.ChromHMM.buildModel(ChromHMM.java:816)
        at edu.mit.compbio.ChromHMM.ChromHMM.main(ChromHMM.java:6412)
ernstlab commented 7 years ago

To generate ChromHMM's parameter images the system needs to have the necessary support for that. I could consider adding the option for ChromHMM not to generate image output in a future version.

-Jason

balwierz commented 7 years ago

Meanwhile, is there a way to circumvent it? I.e. that ChromHMM skips launching a web browser?

avilella commented 7 years ago

I managed to get it to work with:

unset DISPLAY && java -mx1600M -jar $chromhmm LearnModel -s 1 -p $threads -nobrowser $binariesdir $modelsdir $num_states $assembly

On Wed, Oct 11, 2017 at 3:36 PM, Piotr Balwierz notifications@github.com wrote:

Meanwhile, is there a way to circumvent it? I.e. that ChromHMM skips launching a web browser?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jernst98/ChromHMM/issues/1#issuecomment-335832024, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJpN4P6sDH7c4QukFbTrOvQR6MnLJOTks5srNJrgaJpZM4OjuD- .

ernstlab commented 7 years ago

Thanks for sharing avilella.

balwierz - The '-nobrowser' flag skips the launching of the web browser but not the generation of emission parameters images.

jernst98 commented 7 years ago

I've added a -noimage flag in version 1.14 of ChromHMM which suppresses the printing of image out.

-Jason

JohnMCMa commented 5 years ago

I would like to add another solution here. I tested running LearnModel using Sun Java's own headless mode. By adding the flag -Djava.awt.headless=true to the java invocation, ChromHMM generates all figures and did not throw any errors, other than a warning of the inability to open a browser.