Skip to content

Command line

Martin Modrák edited this page May 29, 2018 · 4 revisions

Using Genexpi from the command line

As of 1.3.0 inference is fully accessible from command line, but fit evaluation is not. You can download the command-line version from the releases page. The command line version is also the one used from the (slightly hacky) Matlab interface

Selecting OpenCL device

There are two methods to choose an OpenCL device for use with Genexpi. You can either pass -cpu or -gpu flags to indicate you prefer computation on the CPU/GPU respectively. Alternatively you can first run

java -jar genexpi-standalone.jar --list-devices

To show a list of available devices and their IDs and then pass --device ID to use the device with the given ID. The best devices to use with CyGenexpi are (in the following order):

  1. A dedicated graphics card (GPU) for computing (not connected to a display)
  2. A Xeon Phi card
  3. Your processor (CPU)
  4. A GPU connected to a display

While GPUs will run Genexpi the fastest, using a GPU connected to a display is discouraged as it interferes with the operating system (OS) and may cause your computer to freeze and/or the computations to be reset by the operating system. If you really want to use a GPU connected to a display, pass the --prevent-full-occupation flag, which tries to keep the GPU available to the OS at the cost of reduced performance. On Windows, you may instead disable TDR - Timeout detection and recovery (expert only).

If the list is empty or you do not see the hardware you want to use:

Basic usage

To use Genexpi from the command line, you need three files and you need to choose a model.

As of version 1.3, only two classes of models are supported: NoRegulator and Additive. In the NoRegulator model, genes are tested whether they can be fit with constant synthesis over time. Additive is the main model and expects additive regulatory effects from various regulators. When using the Additive model it is necessary to specify the number of regulators (--num-regulators N) and it is possible to include constitutive expression (a constant regulatory term) in the model as well (--constitutive).

The three input files to Genexpi command line are:

  1. names_file Contains the names of the genes you have time-series data for. One name per line.
  2. profiles_file A CSV file, without header. Each line gives the expression profile of one gene in the same order as in the names_file. The samples are expected to be ordered by time with equal time intervals in between.
  3. tasks_file Uses the names given in names_file to describe which inferences should be made. The contents depends on the model used: a. NoRegulator model: One gene name per line - those genes are tested for the constant synthesis model. b. Additive model: A CSV file without headers. Each line represents a task, the first column contains the target gene, the rest of the columns contain the regulators. The number of columns has to be num_regulators + 1. c. Cooperative model: A CSV file without headers. Each line represents a task, the first column contains the target gene, the two next columns contain names of genes that form a complex regulating the target (the file has to have exactly 3 columns).

Note that the names_file and profiles_file can be reused across multiple invocations with different model and tasks.

You can test Genexpi command line with a set of sample input files.

Understanding output

The output file (created automatically or specified via the --output-file parameter) is a CSV file with header, containing one row for each task. The columns correspond to the target gene, regulators (if any), parameters of the best fitted model and the residual error of the best fitted model.

  • For the NoRegulator model, the parameters are synthesis and decay
  • For the Additive model, the parameters are k1 (maximal synthesis), k2 (decay rate), b (bias of the regulator function) and w1 ... wN weights of individual regulators. (If only one regulator is present, the parameter is simply w).
  • For the Cooperative model, the parameters are k1 (maximal synthesis), k2 (decay rate), b (bias of the regulator function), w (weight of regulatoin) and eq (equilibrium constant for the regulator complex).

Other options

Here is a copy of the help included in the program:

usage: java -jar genexpi-standalone.jar names_file profiles_file
            tasks_file -m <model> [OPTIONS]
 -c,--constitutive                Use constitutive expression in the model
                                  (relevant only for the Additive model)
 -cpu                             Prefer CPU OpenCL platforms
 -dev,--device <arg>              ID of OpenCL device to use (as returned
                                  by --list-devices)
 -e,--error <arg>                 Use given error function. For Additive
                                  model, it can be one of [Euler, RK4,
                                  DerivativeDiff], default is Euler.
 -g,--num-regulators <arg>        Number of regulators (relevant only for
                                  the Additive model).
 -gpu                             Prefer GPU OpenCL platforms
 -l,--loss <arg>                  Use given loss function. One of [Abs,
                                  Squared], default is Squared
 -ldev,--list-devices             List all available OpenCL devices
 -m,--model <arg>                 Use given regulatory model. One of
                                  [NoRegulator, Additive, Cooperative], 
                                  default is additive.
    --method <arg>                Use given optimization method. One of
                                  [Annealing]
 -n,--num-iterations <arg>        Use given number of iterations, default
                                  is 256
 -o,--output-file <arg>           Use given file for output. If not given
                                  a file name is created based on method,
                                  model, error and loss functions
 -pfo,--prevent-full-occupation   Prevent full occupation of the OpenCL
                                  device. Keeps the computer responsive
                                  when computing on the GPU that runs the
                                  main display.
 -r,--regularization <arg>        The weight of regularization, default is
                                  0.
 -step,--time-step <arg>          Time step between the individual time
                                  points (default is 1).
 -w,--weight-constraints <arg>    Optional file containing weight
                                  constraints (+/-1 to restrict to
                                  positive/negative regulations or 0 for
                                  no constraints) for each regulator in
                                  each task.
                                  Applicable only for the Additive model.
Clone this wiki locally