Coder Social home page Coder Social logo

Messy error when no X11 connection about bandage HOT 4 OPEN

rrwick avatar rrwick commented on September 13, 2024
Messy error when no X11 connection

from bandage.

Comments (4)

alexbossers avatar alexbossers commented on September 13, 2024

Hhhhmm I observe the same using version 0.8.0. Want to pipeline some graphs into graphics on an host not gui capable.
Using a remote ssh without X11 forwarding capability returns:
(Bandage:14389): Gtk-WARNING **: cannot open display: localhost:11.0

If I use a host that has x11 forwarding capabilities the tool runs just fine in cmd line mode.
Why is command line mode still checking for a graphical display?

from bandage.

rrwick avatar rrwick commented on September 13, 2024

Alex, what is the exact Bandage command you're using? Specifically I'm curious if you're using Bandage image and including some labels. E.g. Bandage image graph.fastg image.jpg --names

I ran into a frustrating issue with command line image output that isn't fully solved. If Bandage is being used on the command line without a GUI, then I'd prefer to use the Qt 'minimal' platform, as that shouldn't require stuff like X11 connections. That seems to work fine, but I found that if you ran Bandage image with some sort of label on the graph, the text was not rendering (was just black rectangles). When I use the regular GUI-requiring Qt platform, then the text comes out fine (even though a GUI never actually opens).

I've reluctantly concluded that the Qt 'minimal' platform lacks the ability to do font stuff and the GUI mode is required when using Bandage image with labels. So when you run Bandage from the command line, it looks to see if you've asked for labels, and if so, it uses the GUI mode. I'd love to find a way around this, but no luck so far.

In short, if you're using labels on the images, removing them should remove your need for a GUI connection. But if you need labels, then you need GUI capabilities. However, if you're not using labels on your images and still having this issue, then I'm not sure and further investigation is warranted.

from bandage.

alexbossers avatar alexbossers commented on September 13, 2024

Ryan,
thanks for the follow-up. Indeed I try to use labels. But also when I issue the command with soley the option --help or --helpall it fails with the same error.

My pipeline command looks something like:
/opt/bandage/Bandage image $dir/assembly_graph.fastg $dir/assembly_graph.fastg.nodes123.png --names --lengths --depth --fontsize 2 --scope aroundnodes --nodes 1,2,3
So I do need the labels else it doesn't make sense.

I am not so into the graphics business but it seems you try to solve things we ourseleves have seen in the past with some tools on our headless server running R scripts that generate PNG etc. pdf was no issue.
I checked and it was solved by either of the two systems xvfb (a virtual Xserver (frame buffer)) or by using Cairo (https://www.cairographics.org/). The Cairo might be something to look at (maybe you already considered it...).

from bandage.

rrwick avatar rrwick commented on September 13, 2024

I've put a small fix into the development branch of Bandage to not require a GUI when --help or --helpall is used, but that doesn't fix your main problem. And I just double-checked that the behaviour I described (needing a GUI platform to produce text in an image) applies to Linux as well as OS X, and unfortunately it does. The workaround (which you already seem to have discovered) is to use -X or -Y when you ssh. Though I'll make a note to check out Xvfb and Cairo and see if there's a better solution to be had there. Thanks!

from bandage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.