Answers.Body: <p>Running an IGV batch script helps increase the number of reads per image, compared with <code>File | Save image</code>, but it does not solve the issue by itself. </p>
  
  <p>To run a script, first make a script file like so with 1 command per line:</p>
  
  <pre><code>snapshotDirectory ./
  goto chr2:28582094-28582790
  maxPanelHeight 10000
  snapshot chr2_28582094_28582790.png
  </code></pre>
  
  <p>Run the script using <code>Tools | Run batch script</code> menu. The importat trick is the <code>maxPanelHeight 10000</code> which is what makes this include more reads than the default snapshot. </p>
  
  <p>You can also convert this into a little shell script:</p>
  
  <pre><code>#!/bin/bash
  mkdir -p /tmp/igv
  sleep 2
  echo "snapshotDirectory /tmp/igv"
  sleep 2
  goto chr2:28582094-28582790
  sleep 2
  echo "maxPanelHeight 10000"
  echo "snapshot chr2_28582094_28582790.png"
  </code></pre>
  
  <p>Then, just open IGV, load the relevant BAM file and run the script like this to connect to IGV via telnet (<a href="http://plindenbaum.blogspot.com/2011/07/controlling-igv-through-port-my.html" rel="nofollow noreferrer">credit to Pierre Lindenbaum</a>):</p>
  
  <pre><code>sh foo.sh |  telnet 127.0.0.1 60151
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-04T16:44:41.763Z
Answers.LastActivityDate: 2019-11-04T16:51:47.083Z
Answers.LastEditDate: 2019-11-04T16:51:47.083Z
Answers.UserDisplayName: Timur Shtatland
Body: <p>The <a href="http://software.broadinstitute.org/software/igv/" rel="nofollow noreferrer">IGV browser</a> lets you export an alignment as an image (File => Save Image). However, this image only contains those reads that fit in the viewing window:</p>
  
  <p><a href="https://i.sstatic.net/s5Ma9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/s5Ma9.png" alt="IGV screenshot"></a></p>
  
  <p>As you can see in the image above by looking at the scroll bar on the right, this is only a small subset of aligned reads. Is there any way to export an image of the aligned reads that includes <em>all</em> reads and not only those currently shown in the window?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:23:06.987Z
Comments.Text: Running an IGV batch script helps increase the number of reads per image, compared with `File | Save image`, but it does **not** solve the issue. To run a script, first make a script file like so with 1 command per line: ```snapshotDirectory ./
  goto chr2:28582094-28582790
  snapshot chr2_28582094_28582790.png
  goto chr4:8203487-8203815
  snapshot chr4_8203487_8203815.png``` Run the script using `Tools | Run batch script` menu.
Comments.UserDisplayName: Timur Shtatland
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:23:35.927Z
Comments.Text: @TimurShtatland sorry, I have no idea what that is supposed to mean. That looks like a set of scripting commands and I have a vague recollection of having seen something like that for IGV in the past. Could you please post an answer explaining what you are suggesting?
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:27:00.177Z
Comments.Text: Oops, pasted the wrong thing. Fixed this. IMO, this is not an answer, but might help partially.
Comments.UserDisplayName: Timur Shtatland
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:30:29.487Z
Comments.Text: @TimurShtatland yes, thanks. I'd posted my comment before your edit :). If the scripting approach does give more reads, then it's at least a partial solution and deserves an answer. Could you flesh your comment into an answer? If you'd rather not, I can post one as soon as I've tested it, but you deserve the rep.
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:38:58.810Z
Comments.Text: @TimurShtatland well, this is embarrassing. Your comment made me find an old script I had which does exactly this! I had completely forgotten! Please post an answer, you should get the credit, and then I'll just edit it to add what I did to get everything (essentially, you can set `maxPanelHeight` to get more reads).
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:46:22.203Z
Comments.Text: Thank you, done. Please feel free to edit. I don't deserve the full credit obviously, so I owe you half. :)
Comments.UserDisplayName: Timur Shtatland
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:52:33.610Z
Comments.Text: @TimurShtatland thanks, but that's fine. The credit belongs to Pierre whose post I'd managed to find last time I needed this and then promptly forgot about until your comment reminded me :). And I already have all the editing privileges rep can buy here, so you need it more!
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T16:56:09.927Z
Comments.Text: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/100681/discussion-between-timur-shtatland-and-terdon).
Comments.UserDisplayName: Timur Shtatland
Tags: <sam><ngs><visualization><igv>
Title: How can I export a full alignment from IGV as an image?
ThreadText: # How can I export a full alignment from IGV as an image?
  
  (Asked by: username_0 on 2019-11-04)
  
  The [IGV browser](http://software.broadinstitute.org/software/igv/) lets you export an alignment as an image (File => Save Image). However, this image only contains those reads that fit in the viewing window:
  
  [![IGV screenshot](https://i.sstatic.net/s5Ma9.png)](https://i.sstatic.net/s5Ma9.png)
  
  As you can see in the image above by looking at the scroll bar on the right, this is only a small subset of aligned reads. Is there any way to export an image of the aligned reads that includes *all* reads and not only those currently shown in the window?
  
  **Tags:** sam, ngs, visualization, igv
  
  > **Comments:**
  > **username_1**: Running an IGV batch script helps increase the number of reads per image, compared with `File | Save image`, but it does **not** solve the issue. To run a script, first make a script file like so with 1 command per line: ```snapshotDirectory ./ goto chr2:28582094-28582790 snapshot chr2_28582094_28582790.png goto chr4:8203487-8203815 snapshot chr4_8203487_8203815.png``` Run the script using `Tools | Run batch script` menu.  
  > **username_0**: @username_1 sorry, I have no idea what that is supposed to mean. That looks like a set of scripting commands and I have a vague recollection of having seen something like that for IGV in the past. Could you please post an answer explaining what you are suggesting?  
  > **username_1**: Oops, pasted the wrong thing. Fixed this. IMO, this is not an answer, but might help partially.  
  > **username_0**: @username_1 yes, thanks. I'd posted my comment before your edit :). If the scripting approach does give more reads, then it's at least a partial solution and deserves an answer. Could you flesh your comment into an answer? If you'd rather not, I can post one as soon as I've tested it, but you deserve the rep.  
  > **username_0**: @username_1 well, this is embarrassing. Your comment made me find an old script I had which does exactly this! I had completely forgotten! Please post an answer, you should get the credit, and then I'll just edit it to add what I did to get everything (essentially, you can set `maxPanelHeight` to get more reads).  
  > **username_1**: Thank you, done. Please feel free to edit. I don't deserve the full credit obviously, so I owe you half. :)  
  > **username_0**: @username_1 thanks, but that's fine. The credit belongs to Pierre whose post I'd managed to find last time I needed this and then promptly forgot about until your comment reminded me :). And I already have all the editing privileges rep can buy here, so you need it more!  
  > **username_1**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/100681/discussion-between-username_1-username_1-and-username_0).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-04. Score: 4 | Accepted answer
  
  Running an IGV batch script helps increase the number of reads per image, compared with `File | Save image`, but it does not solve the issue by itself.
  
  To run a script, first make a script file like so with 1 command per line:
  
  ```
  snapshotDirectory ./
  goto chr2:28582094-28582790
  maxPanelHeight 10000
  snapshot chr2_28582094_28582790.png
  
  ```
  
  Run the script using `Tools | Run batch script` menu. The importat trick is the `maxPanelHeight 10000` which is what makes this include more reads than the default snapshot.
  
  You can also convert this into a little shell script:
  
  ```
  #!/bin/bash
  mkdir -p /tmp/igv
  sleep 2
  echo "snapshotDirectory /tmp/igv"
  sleep 2
  goto chr2:28582094-28582790
  sleep 2
  echo "maxPanelHeight 10000"
  echo "snapshot chr2_28582094_28582790.png"
  
  ```
  
  Then, just open IGV, load the relevant BAM file and run the script like this to connect to IGV via telnet ([credit to Pierre Lindenbaum](http://plindenbaum.blogspot.com/2011/07/controlling-igv-through-port-my.html)):
  
  ```
  sh foo.sh |  telnet 127.0.0.1 60151
  
  ```
  
  
  ---
  
  