Up: Component summary Component

ScriptIGV

Still under construction! Only the one file input and bedtools igv mode work at the moment, as evidenced by the only test case. Both the network and offline modes should work.

As IGV is a GUI and this component is mainly meant to take screenshots, you need to have a working setup for that.

Allows you to run a batch job either by starting an IGV for just that purpose, or to communicate with an already running instance over a TCP connection. If the instance is started, then you need a working display on the node you are using, e.g. a VNC and the DISPLAY variable set. So, it may be easier to start IGV first yourself.

Batch processing allows to e.g. take screenshots of genomic regions, which is the only output of the component. Inside the folder, the screenshots can be organized into subdirectories, depending on your script. Or you can place them in any writable location.

If you can think of other type of outputs, let me know.

For network control (so called "Port Commands") to work, the option needs to be enabled in IGV preferences. For me it was enabled by default.

In both cases, the input is a script containing a batch job, or a script may be generated by this component from a list of regions. The commands are defined in the IGV manual.

Tracks from the track input array are opened in IGV before anything else, and all commands apply to all of them by default. (In the future: You can refer to the tracks with the array's keys as @track_key@, where key must be substituted with the key. Or you can use the filename directly, because IGV names them automatically by their filename.)

The script may either be a raw IGV batch job, or have a few additional elements, to account for your input files. The inputs "file" and "array" are region sets (BED, BAM, CSV, GTF, ... ) that you want to iterate over, taking a snapshot for each region. Usually you would only need to use the "file" input.

The snapshot directory is by default set to the corresponding output. @snapshotDirectory@ is substituted in the script as the location of the screenshot output. In case you want to alternate the snapshot directory for each file, you can use e.g. "snapshotDirectory @snapshotDirectory@/@filename@"

@file@ will be substituted by the file input's basename

A pair of HTML-style loop tags specifies a set of commands to repeat for each applicable input.

Inside a pair of loop tags, the string @filename@ will be substituted with files from the input array or folder. The string between @@ is interpreted as a regular expression matching the filename, so you can use @.*@ or as a convenience @file@ to apply the snippet to all files.

Nothing forces you to use that, you can reference any file, so you can e.g. use a script produced by bedtools' igv command.

@coord@ will be substituted by the current region's coordinates

And finally, instead of relying on this explanation, it's best to look at the component test cases.

E.g. sending a faulty filename to IGV may cause it to throw an exception and stop listening on the socket altogether. Perhaps a timeout should be implemented, because otherwise receiving the reply from IGV may block. Therefore easiest to implement your scripts without a host set.

ERROR [2013-09-18 13:56:34,036]  [DefaultExceptionHandler.java:42] [Thread-6]  Unhandled exception
java.lang.NullPointerException
    at org.broad.igv.ui.util.SnapshotFileChooser.getSnapshotFileType(SnapshotFileChooser.java:66)
    at org.broad.igv.ui.IGV.createSnapshotNonInteractive(IGV.java:992)
    at org.broad.igv.batch.CommandExecutor.createSnapshot(CommandExecutor.java:642)
    at org.broad.igv.batch.CommandExecutor.execute(CommandExecutor.java:125)
    at org.broad.igv.batch.CommandListener.processClientSession(CommandListener.java:163)
    at org.broad.igv.batch.CommandListener.run(CommandListener.java:76)
    at java.lang.Thread.run(Thread.java:679)

Version 0.1
Bundle sequencing
Categories
Authors Lauri Lyly (lauri.lyly@helsinki.fi)
Issue tracker View/Report issues
Requires python ; IGV ; bedtools ; installer (bash)
Source files component.xml igv_control.py
Usage Example with default values
Deprecated

This component requires grok which is not needed to use igv. No one is using this component, and grok installation is not easy.

Inputs

Name Type Mandatory Description
scriptFile TextFile Optional Batch job to run. The snippet will be repeated for each input region set. If unspecified, the script parameter is used instead. This is e.g. to allow for a default script.
file BinaryFile Optional Region set to generate script from.
array Array<BinaryFile> Optional More region sets to generate script from.
tracks Array<BinaryFile> Optional Tracks to be opened by the batch script. All of them are loaded at start. You can refer to them by the array keys, surrounded by @@, after the commands which accept track names, i.e. expand, collapse, squish, viewaspairs.
session TextFile Optional Existing IGV session file to be loaded prior to running the script.
igv TextFile Optional Shell script which starts IGV and supplies extra parameters to it. If not specified, igv.sh is assumed to reside on the PATH. The shell script must start with a proper #! (shebang), e.g. "#!/bin/bash". If you get an error such as "OSError: [Errno 8] Exec format error" it's because that is lacking.

Outputs

Name Type Description
screenshots BinaryFolder Screen captures. May have subdirectories.

Parameters

Name Type Default Description
bedtoolsOptions string "" Set a value to produce the script by running the bedtools igv command. Leaving it empty means bedtools will not be run. The command to run bedtools has the format "bedtools igv [OPTIONS] -i INPUT_FILE" and is ran once per input file. To pass no other options besides the input file itself, use "default"
host string "" Host to connect to using a network socket. If you leave this empty, IGV is launched locally.
igvOptions string "" Options to pass to IGV, if it needs to be started, in addition to the script itself. Mostly of interest would likely be "-o file, --preferences=file".
port int 60151 Port for TCP connection
script string "" The default script takes screenshots in the screenshot output directory. It uses bedtools igv (see the "bedtoolsOptions" parameter) if available.

Test cases

Test case Parameters IN
scriptFile
IN
file
IN
array
IN
tracks
IN
session
IN
igv
OUT
screenshots
case1 properties (missing) file (missing) (missing) (missing) (missing) (missing)

host=127.0.0.1,
bedtoolsOptions=default

case2 properties (missing) file (missing) (missing) (missing) (missing) (missing)

host=,
bedtoolsOptions=default

case3 properties (missing) file (missing) (missing) (missing) (missing) (missing)

host=

case4 properties (missing) file (missing) tracks (missing) (missing) (missing)

host=127.0.0.1


Generated 2018-12-18 07:42:27 by Anduril 2.0.0