3
$\begingroup$

The IGV browser 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

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?

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Timur Shtatland Nov 4 '19 at 16:23
  • $\begingroup$ @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? $\endgroup$ – terdon Nov 4 '19 at 16:23
  • $\begingroup$ Oops, pasted the wrong thing. Fixed this. IMO, this is not an answer, but might help partially. $\endgroup$ – Timur Shtatland Nov 4 '19 at 16:27
  • $\begingroup$ @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. $\endgroup$ – terdon Nov 4 '19 at 16:30
  • $\begingroup$ @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). $\endgroup$ – terdon Nov 4 '19 at 16:38
3
$\begingroup$

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):

sh foo.sh |  telnet 127.0.0.1 60151
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.