stevekm/IGV-snapshot-automator

Unable to change genome

scchess opened this issue · 2 comments

The script (-g option or changing the source code directly) always default to the first genome in IGV. I couldn't make it to using the second genome which is hg38 on my machine.

Doesn't look like I am able to reproduce the issue. I just ran this command:

python make_IGV_snapshots.py test_alignments.bam -g hg38

And this was some of the console output:

Running the IGV command...
INFO [2017-03-06 09:28:58,032] [DirectoryManager.java:169]  IGV Directory: /ifs/home/kellys04/igv
INFO [2017-03-06 09:28:58,032]  [DirectoryManager.java:169] [main]  IGV Directory: /ifs/home/kellys04/igv
INFO [2017-03-06 09:28:58,098]  [Main.java:133] [main]  Startup  IGV Version 2.3.81 (127)08/30/2016 02:20 PM
INFO [2017-03-06 09:28:58,098]  [Main.java:134] [main]  Java 1.6.0_41
INFO [2017-03-06 09:28:58,098]  [DirectoryManager.java:72] [main]  Fetching user directory...
INFO [2017-03-06 09:28:59,136]  [Main.java:135] [main]  Default User Directory: /ifs/home/kellys04
INFO [2017-03-06 09:28:59,137]  [Main.java:136] [main]  OS: Linux
INFO [2017-03-06 09:29:00,203]  [Main.java:184] [main]  A later version of IGV is available (2.3.84)
INFO [2017-03-06 09:29:21,765]  [GenomeManager.java:1017] [main]  java.io.FileNotFoundException: /ifs/home/kellys04/igv/genomes/user-defined-genomes.txt (No such file or directory)
INFO [2017-03-06 09:29:22,514]  [GenomeManager.java:145] [main]  Loading genome: /ifs/home/kellys04/igv/genomes/hg19.genome
INFO [2017-03-06 09:29:24,826]  [GenomeManager.java:192] [main]  Genome loaded.  id= hg19
INFO [2017-03-06 09:29:25,017]  [CommandListener.java:106] [Thread-6]  Listening on port 60151
INFO [2017-03-06 09:29:25,034]  [BatchRunner.java:72] [pool-1-thread-1]  Executing Command: new

INFO [2017-03-06 09:29:28,113]  [CommandExecutor.java:235] [pool-1-thread-1]  OK
INFO [2017-03-06 09:29:28,114]  [BatchRunner.java:72] [pool-1-thread-1]  Executing Command: snapshotDirectory IGV_Snapshots

INFO [2017-03-06 09:29:30,134]  [CommandExecutor.java:235] [pool-1-thread-1]  OK
INFO [2017-03-06 09:29:30,134]  [BatchRunner.java:72] [pool-1-thread-1]  Executing Command: load test_alignments.bam

INFO [2017-03-06 09:29:30,138]  [IGV.java:1700] [pool-1-thread-1]  Loading 1 resources.
INFO [2017-03-06 09:29:30,140]  [TrackLoader.java:120] [pool-1-thread-1]  Loading resource, path test_alignments.bam
INFO [2017-03-06 09:29:32,408]  [CommandExecutor.java:235] [pool-1-thread-1]  OK
INFO [2017-03-06 09:29:32,408]  [BatchRunner.java:72] [pool-1-thread-1]  Executing Command: genome hg38

INFO [2017-03-06 09:29:33,246]  [GenomeManager.java:145] [pool-1-thread-1]  Loading genome: http://s3.amazonaws.com/igv.broadinstitute.org/genomes/hg38.genome
INFO [2017-03-06 09:29:33,263]  [URLDownloader.java:89] [pool-1-thread-1]  Downloading http://s3.amazonaws.com/igv.broadinstitute.org/genomes/hg38.genome to /ifs/home/kellys04/igv/genomes/hg38.genome
INFO [2017-03-06 09:29:34,023]  [URLDownloader.java:130] [pool-1-thread-1]  Download complete.  Total bytes downloaded = 3313098
INFO [2017-03-06 09:29:35,609]  [GenomeManager.java:192] [pool-1-thread-1]  Genome loaded.  id= hg38
INFO [2017-03-06 09:29:37,693]  [CommandExecutor.java:235] [pool-1-thread-1]  OK
INFO [2017-03-06 09:29:37,694]  [BatchRunner.java:72] [pool-1-thread-1]  Executing Command: maxPanelHeight 500

You can see here that hg19 was indeed loaded by IGV at first, but then IGV followed the commands in the batch script and downloaded & loaded hg38 before taking snapshots. The snapshots were made successfully but did not contain any reads, I am guessing since the alignment file was made with hg19.

Two things come to mind: is 'hg38' being written to you batchscript? And is your IGV actually able to load hg38? It might be easier to check on the latter if you can load IGV normally; on a headless server, you can do this by installing X11 or XQuartz (Mac) on your local machine, and ssh'ing in with the -Y argument, then loading IGV with bin/IGV_2.3.81/igv.sh, and trying to select hg38.

My batchscript file after running that command looks like this:

$ cat IGV_Snapshots/IGV_snapshots.bat
new
snapshotDirectory IGV_Snapshots
load test_alignments.bam
genome hg38
maxPanelHeight 500
goto chr1:713167-714758
snapshot chr1_713167_714758_h500.png
goto chr1:713500-714900
snapshot chr1_713500_714900_h500.png
goto chr1:714000-715000
snapshot chr1_714000_715000_h500.png
goto chr1:714001-714001
snapshot chr1_714001_714001_h500.png
exit

Let me know if this helps.

I figure out the problem and it's my fault.