<p>I am trying to get screenshots from alignments of reads to a genome in <a href="http://software.broadinstitute.org/software/igv/" rel="nofollow noreferrer">IGV</a> (Integrated Genome Viewer) using <a href="https://github.com/macarthur-lab/igv_utils/tree/master/igv_plotter" rel="nofollow noreferrer">igv_plotter</a>.</p>

<pre><code>igv_plotter --genome ref.fa readsSorted.bam --locus-file locus_file.txt --max-memory 10G

Traceback (most recent call last):
  File "/Users/user/anaconda/envs/python3env/bin/igv_plotter", line 140, in &lt;module&gt;
    igv_robot.execute()
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/igv_api.py", line 256, in execute
    self._execute_impl(self.__command_queue)
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/igv_api.py", line 387, in _execute_impl
    fake_display.start()
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/xvfbwrapper.py", line 79, in start
    raise RuntimeError('Xvfb did not start')
RuntimeError: Xvfb did not start
</code></pre>

<p>locus_file.txt only contains this: <code>I:10,000-20,000</code>. From reading online, it seems that this Xvfb is what I need to be able to use IGV without a GUI. I am working on Mac High Sierra and I don't know if I can install Xvfb on Mac OS X or how I can do it. I was quickly out of my depths on the online posts about Xvfb on Mac. I checked that I installed igv_plotter correctly by successfully pulling out the help with <code>igv_plotter -h</code>. I could not find Xvfb using brew.</p>

<p>Alternatively, is there another programmatic way of taking images of aligned reads to a reference, similar to the one below?<a href="https://i.sstatic.net/Ie14x.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ie14x.png" alt="reads aligned to a reference"></a></p>

<p>Opening IGV and making a screenshot is not a viable option for me, as I would like to export hundreds or thousands or regions.</p>

CC BY-SA 3.0
2018-03-13T12:15:45.423Z
Hi, What is your question getting igv_plotter to work or find an alternative? If the first, why don't you use the gui to make the screenshots?
llrs
CC BY-SA 3.0
2018-03-13T12:18:15.480Z
@Llopis Maybe because the result is unusable (importing it in Illustrator yields rubbish that’s very time-consuming to unravel).
Konrad Rudolph
CC BY-SA 3.0
2018-03-13T12:24:27.490Z
Did you install XQuartz on your macOS? It should include Xvfb.
Konrad Rudolph
CC BY-SA 3.0
2018-03-13T12:54:57.723Z
@Llopis, I want to automate this for thousands of regions, so opening the GUI is not an option.
Biomagician
CC BY-SA 3.0
2018-03-13T12:57:08.523Z
@KonradRudolph XQuartz is installed on my macOS. Not sure what it is for but I can open it and it works like a Terminal.
Biomagician
<phylogenetics><visualization><igv>
igv_plotter error: Xvfb did not start
# igv_plotter error: Xvfb did not start

(Asked by: username_0 on 2018-03-13)

I am trying to get screenshots from alignments of reads to a genome in IGV (Integrated Genome Viewer) using igv_plotter.
igv_plotter --genome ref.fa readsSorted.bam --locus-file locus_file.txt --max-memory 10G

Traceback (most recent call last):
  File "/Users/user/anaconda/envs/python3env/bin/igv_plotter", line 140, in 
    igv_robot.execute()
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/igv_api.py", line 256, in execute
    self._execute_impl(self.__command_queue)
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/igv_api.py", line 387, in _execute_impl
    fake_display.start()
  File "/Users/user/anaconda/envs/python3env/lib/python3.6/site-packages/xvfbwrapper.py", line 79, in start
    raise RuntimeError('Xvfb did not start')
RuntimeError: Xvfb did not start

locus_file.txt only contains this: I:10,000-20,000. From reading online, it seems that this Xvfb is what I need to be able to use IGV without a GUI. I am working on Mac High Sierra and I don't know if I can install Xvfb on Mac OS X or how I can do it. I was quickly out of my depths on the online posts about Xvfb on Mac. I checked that I installed igv_plotter correctly by successfully pulling out the help with igv_plotter -h. I could not find Xvfb using brew.
Alternatively, is there another programmatic way of taking images of aligned reads to a reference, similar to the one below?
Opening IGV and making a screenshot is not a viable option for me, as I would like to export hundreds or thousands or regions.

**Tags:** phylogenetics, visualization, igv
> **Comments:**
> **username_1**: Hi, What is your question getting igv_plotter to work or find an alternative? If the first, why don't you use the gui to make the screenshots?  
> **username_2**: @Llopis Maybe because the result is unusable (importing it in Illustrator yields rubbish that’s very time-consuming to unravel).  
> **username_2**: Did you install XQuartz on your macOS? It should include Xvfb.  
> **username_0**: @Llopis, I want to automate this for thousands of regions, so opening the GUI is not an option.  
> **username_0**: @KonradRudolph XQuartz is installed on my macOS. Not sure what it is for but I can open it and it works like a Terminal.  

---

## 0 answers

