Snapshot Control

232 views
Skip to first unread message

Ron

unread,
Sep 11, 2011, 2:36:34 PM9/11/11
to igv-help
Hi all,

Is there a way to get more precise control over the snapshots
generated via a batch file? For instance, I would like to be able to
export an image of a track with a particular height and width, e.g.:

##batch.txt##
new
genome mm9
load chip.cov.tdf
snapshotDirectory .
goto chr1:10000000-15000000
snapshot chip.cov.tdf 500 500

which would output a snapshot of ONLY the chip.cov.tdf track @ the
specified coordinates. That is, it would exclude the position markers,
the gene tracks, etc.

Thanks!

Ron

James Robinson

unread,
Sep 11, 2011, 4:04:52 PM9/11/11
to igv-...@googlegroups.com
Hi,

That's not currently possible.  I'll enter this as a request for a future release. 

-- Jim

Colin Hercus

unread,
Mar 3, 2022, 3:12:58 AM3/3/22
to igv-help
Hi,

I'd also like to be able to control width and height of tracks in a snapshot. Most important need is higher width for better base resolution on gene snapshots. Track heights I can manage using imagemajik to crop images.

Thanks, Colin

Colin Hercus

unread,
Mar 3, 2022, 3:31:19 AM3/3/22
to igv-help
I'm not a java programmer but just googled on Java window size and it could just be the initial JFrame window width that then affects the snapshot. A command line option to set JFrame size or Maximise might be useful.

Thanks, Colin

igv-help

unread,
Mar 4, 2022, 2:44:15 AM3/4/22
to igv-help
I don't know what you mean by "command line".  IGV is an interactive GUI program, there is no command line.     Could you elaborate on what you mean by "command line option"? 

Colin Hercus

unread,
Mar 4, 2022, 3:48:44 AM3/4/22
to igv-...@googlegroups.com
Hi,
Thanks for responding.

When I run igv with a batch file I start it like this..

./igv/IGV_Linux_2.12.2/igv.sh --batch batchCommands.igv

and the GUI always opens at a fixed size that I can't change by batch commands. So I'd like to be able to set the size of the window that gets opened.

And I was thinking if we could add a new option --windowsize and run igv  like

./igv/IGV_Linux_2.12.2/igv.sh --batch tgtgenes.igv  ---windowsize 1600x1280
 or
./igv/IGV_Linux_2.12.2/igv.sh --batch tgtgenes.igv  ---windowsize maximise

igv.sh starts java like

java -showversion --module-path="${prefix}/lib" -Xmx8g \
        @"${prefix}/igv.args" \
        -Dapple.laf.useScreenMenuBar=true \
        -Djava.net.preferIPv4Stack=true \
        --module=org.igv/org.broad.igv.ui.Main "$@"

so the option --windowsize would be passed into module  org.igv/org.broad.igv.ui.Main

which could then parse the option and use the size for the JFrame.

Note, I've never programmed Java so I may be wrong about JFrame but there must be a java api call to open the window.

Best Regards, Colin





--

---
You received this message because you are subscribed to a topic in the Google Groups "igv-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/igv-help/Gzi-KMSQ8Ec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/f20eb58c-7b28-4552-974e-0c85fb822de7n%40googlegroups.com.

James Robinson

unread,
Mar 4, 2022, 11:49:50 AM3/4/22
to igv-...@googlegroups.com
It just occurred to me you can set this vis user preferences.    The key is "IGV.Bounds"  why is a rectangle, left, top, width, height.   There is a command line option to set a preference, but also if you are using the same machine it should reopen with the last bounds value, so if you adjust it with the UI once you shouldn't have to do it again.  

IGV.Bounds=780,128,1546,1173

Colin Hercus

unread,
Mar 6, 2022, 9:32:33 PM3/6/22
to igv-...@googlegroups.com
HI James,

That sounds like a good way to do it but I couldn't get it to work.

I can see this in the prefs.properties file

IGV.Bounds=28,24,3812,804

but if I open IGV it doesn't use it, always opening at 1150x800.

I then tried

echo 'IGV.Bounds=780,128,1546,1173' >igv.pref
igv.sh --preferences igv.pref

But window still opened at 1150x800

I tried putting an invalid preference code but this didn't trigger an error.

I then tried

echo 'DEFAULT_GENOME_KEY=hg19' >igv.pref

and it opens with hg19 rather than my usual grch38.

So it looks like igv is ignoring the IGV.Bounds option.

Best Regards, Colin

James Robinson

unread,
Mar 6, 2022, 10:47:22 PM3/6/22
to igv-...@googlegroups.com
That's strange.  If you try to exceed the bounds of the screen IGV is running on they will be ignored.   If you open IGV with the UI, resize and move it, close then re-open it, does it open with the same position and size?

 

Colin Hercus

unread,
Mar 6, 2022, 10:51:22 PM3/6/22
to igv-...@googlegroups.com
I have multiple monitors and would like to open it across two monitors so that I get close to base level resolution.

It looks like --preferences works as long as I don't try to extend over 2 screens :(



Colin Hercus

unread,
Mar 6, 2022, 11:01:25 PM3/6/22
to igv-...@googlegroups.com
Perhaps you could remove the restriction to screen size and let users make their own choice.

James Robinson

unread,
Mar 6, 2022, 11:52:26 PM3/6/22
to igv-...@googlegroups.com
Maybe, but it would be difficult with that preference, we would need something explicit.  The reason it is there is because user A might run IGV with their external monitor,  then try to open IGV on their disconnected laptop later.   If the bounds are larger than the physical screen they are stuck, possibly no way to even close IGV.

This is getting too complex of this help forum, the purpose of which is to answer questions.   If you want to pursue this open an issue at github.com/igvteam/igv/issues.

Colin Hercus

unread,
Mar 7, 2022, 12:58:56 AM3/7/22
to igv-...@googlegroups.com
Hi James,

Thanks for your help. I won't bother with an issue as I can resize my window and run the batch script from the tools menu. It works okay because I do all snapshots in one script at the same size. It would be nice if I could just script the whole thing but I can live with it the way it is..


Thanks again, Collin

Reply all
Reply to author
Forward
0 new messages