`qiime tools view` on headless server

Thanks for the responses. The suggested approach about adding a line to the matplotlibrc solved the problem. “qiime info” now shows the installed plugins. (see below). In a possibly related issue I was verifying the environment by working through the Moving Pictures tutorial which works until I attempt to view something. For example when I try to view demux-qual-plots.qzv I get the following error. I’m guessing that this will start a web browser (?) to read the index.html created in a subdirectory of /tmp although I can’t find evidence of the file ever being created. Just that it can’t open it. Thanks for your advice. I checked /var/log for evidence of permissions error (sometimes app.armor causes problems like this) but didn’t see evidence of that. I did an strace of the command and it doesn’t appear to be creating the file. Best Regards

ubuntu@ip-172-31-51-10:~$ cd qiime2-moving-pictures-tutorial/
ubuntu@ip-172-31-51-10:~/qiime2-moving-pictures-tutorial$ ls
demux-qual-plots.qzv  demux.qza  out  raw-sequences  raw-sequences.qza  rep-seqs.qza  Rplots.pdf  sample-metadata.tsv  table.qza  table.qzv

ubuntu@ip-172-31-51-10:~/qiime2-moving-pictures-tutorial$ source activate qiime2

(qiime2) ubuntu@ip-172-31-51-10:~/qiime2-moving-pictures-tutorial$ qiime tools view demux-qual-plots.qzv

Viewing visualization failed while attempting to open /tmp/qiime2-archive-0zhj0c9b/9f5482db-77c1-4751-be22-1a8687e0fd82/data/index.html
(qiime2) ubuntu@ip-172-31-51-10:~/qiime2-moving-pictures-tutorial$ 

Note that suggested fix worked

`echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc`

(qiime2) ubuntu@ip-172-31-51-10:~$ qiime info
System versions
Python version: 3.5.2
QIIME version: 2.0.6
q2cli version: 0.0.6

Installed plugins
alignment 0.0.6
composition 0.0.1
dada2 0.0.6
demux 0.0.6
diversity 0.0.6
emperor 0.0.6
feature-classifier 0.0.6
feature-table 0.0.6
phylogeny 0.0.6
taxa 0.0.6
types 0.0.6

Application config directory
/home/ubuntu/.config/q2cli

Hi @steviep, This issue is related to the headless server issue from before. qiime tools view uses the registered system application to open the visualization index (e.g. index.html -> web browser, index.pdf -> pdf viewer, index.txt -> text editor). Without a desktop environment, qiime has no way of handling the request to open the visualization (you don’t have any applications to view it with!). I have opened up a bug report/feature request here — we will make sure that the failure notice is more meaningful, and will suggest alternatives for viewing visualizations in reduced/headless environments.

For now, you have a few options:

  • Transfer the artifacts to your local workstation using SFTP/SCP/etc:

    # On your local machine:
    $ scp -i /path/to/identity_file.pem \
        user@qiime-server:/path/to/viz.qzv \
        /local/path/where/we/should/put/the/viz.qzv
    
  • open the artifact using https://view.qiime2.org

  • install qiime2 locally (you only need qiime2 and q2cli), and run qiime tools view there

  • Upgrade your Ubuntu 16.04 installation from a server install to a desktop install. You will need to Google around about how to do this, but last time I did something similar it looked like: sudo apt-get update && sudo apt-get install ubuntu-desktop. Once upgraded you would need to do something like X forwarding or set up a VNC connection to log in graphically. YMMV.

Personally I would go with the file transfer option, and use https://view.qiime2.org! Hope that helps!

3 Likes

Thanks for the rapid response. I just added the desktop package and everything was fine after that. Specifically I was able to successfully view the artifact. I’m evaluating scenarios for myself and others in my group and since we have a mixture of OSX and Windows (with X Server software) we might do work that way since we can create and AMI and spin up a large (or smaller) server when needed. Thanks again - I’m now working through the Qiime 2 Studio and have run into some problem though before I post that experience I’ll work through it some more to make sure I’ve done what was requested in the document. Best, Steve

Also the issues I was having with npm disappeared once I got sorted out with the ubuntu-desktop. Thanks again

A post was split to a new topic: Matplotlib Configuration Issues

Maybe this should be a different topic, but I just wanted to point out alternative for viewing qiime2 visualizations on a headless server:

@Gluque has created a tool that launches a simple web server to quickly visualize the contents locate into the data folder from a Qiime 2 visualization artifact. Check it out at https://github.com/leylabmpi/qiime_2_ll_quick_viewer

It should be simple to install, and it works really well!

1 Like