As of version 1.7.0 Gitools can be addressed from outside of the application. At the moment there is one command availabe.
Gitools is listening to the port 50151 by default. So it is possible to send the commands to this port. Alternatively it is possible to change the port by editing the ui.xml file in the Gitools configuration folder. (For Linux and Mac OS X users this should be at /.gitools).
Command | Description | Options | as of Version |
---|---|---|---|
add-header-colored-labels | Adds a new colored labels header |
|
2.0.0 |
add-header-text-labels | Adds a new text header to the heatmap |
|
2.0.0 |
close | Closes a heatmap and optionally saves (as) |
|
2.2.1 |
help | Prints all available commands | ||
load matrix-file | Tells Gitools to load a file. |
|
1.7.0 |
sort-by-annotation | Sorts the heatmap by col or row annotation |
|
2.2.0 |
sort-mutex | Sorts the visible layer by mutual excl. |
|
2.2.1 |
version | Prints Gitools version. | 1.7.1 |
There is several ways to send the commands listed above to Gitools. We will make three examples here:
With a terminal application that lets you execute command line you can create a new Gitools instance with command to execute upon startup.
$ gitools load /home/user/matrix-file.tdm --cols /home/user/col-annotations.tsv --rows /home/user/row-annotations.tsv
By HTTP it is possible to send the command like this:
$ https://localhost:50151/load?file=/home/user/matrix-file.tdm&cols=/home/user/col-annotations.tsv&rows=/home/user/row-annotations.tsv
Python or any other programming environment can make use of the Telnet internet protocol. See below to understand how python can connect to Gitools and send it a command.
import socket
def gitools_command(command):
gitools = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
gitools.connect(("localhost", 50151))
gitools.sendall( command.encode('utf-8'))
gitools.close()
command = "load /home/user/matrix-file.tdm --cols /home/user/col-annotations.tsv --rows /home/user/row-annotations.tsv"
gitools_command(command)