Simplex

Overview

Simplex automatically aligns the specified wavelengths to a reference wavelength and outputs the alignment parameters. The aligned data is generated as well, if desired. The alignment compensates for translation and magnification differences between the different wavelengths.

Currently, unprocessed data do not compensate for magnification and translation diffences between the different wavelengths used in data collection. This can result in problems analyzing data when it is important to know how differently-labeled objects are positioned with respect to each other.

Simplex uses a multi-parameter r-factor minimization based on the simplex method, as written in Numerical Recipes (see section 10.4, pages 289-293 in either general or FORTRAN versions). This program requires that one or more structures have data in multiple wavelengths, either by using bleedthrough (e.g. excite in DAPI, and record emission in Texas Red or FITC) or by using an object that is labelled with multiple fluorphores (e.g. multicolored beads). This program uses a simplex to minimize the r-factor calculated from differences between these images. All data is loaded into memory as two byte integers to reduce data storage sizes.

Basic usage

  1. Record dataset with either additional reference bleedthrough images or reference beads located within the dataset. The dataset can be spread over two files if more than 5 wavelengths are recorded. If there is more than one file, the -in2 option must be used. The order of wavelengths in the input file(s) must be kept in mind when specifying wavelengths.
  2. Process data through ccdcor and decon, as with any other dataset.
  3. Select the reference wavelength, align wavelengths, and compare wavelengths. These are all thereoretically optional, as there is a default setting for each, but you really don't want to use that! You must specify which wavelength (by order in the file) in which file, using the -refwave, -alignwaves, and -comparewaves options. See below for exact details on the usage of these options.
  4. (optional) Select wavelenghths to be simply passed to final file. If you have data which you want in the final output file, but you either don't want or don't have the option to align, use the -pass option.
  5. (optional) By default, the wavelength used for alignment is included as the first wavelength when aligned data is generated. If you do not want it included there, use the -norefout option.
  6. (optional) Select the region over which you want your data aligned. The minimum and maximum pixel values are given to Simplex by the -x, -y, and -z options. The default is that the whole dataset will be aligned. Typically, the default option is better to use, but larger datasets can be trimmed to decrease the running time.
  7. Select the region over which you want to compare the image alignments. Simplex will align the entire region defined by the -x, -y, and -z options, but will only use the region defined within the -compxyz option. Unlike the -x, -y, and -z options, the -compxyz option is required!
  8. (optional) Estimate background values to subtract from the reference and compare wavelengths in order to minimize effects of background noise from the r-factor calculations. This option isn't required, as the default will be zero for any wavelengths not supplied with an integer value to subtract.
  9. (optional) Estimate starting translations (-tstart) and scale (-scale) to improve the speed of Simplex reaching the tolerance value. You can also specify to have an edge rolloff (-rolloff) in microns as well. These are optional, real values. Usually, only the -scale option is readily estimable.
  10. (optional) Determine the tolerance (-tol) you're willing to have in your alignment. The default is set at 0.0001, which appears to be a reasonable value.
  11. (optional) Select a name for the output file (-out option). If no output file is selected, the final alignment values will only be printed on the screen (or specified file -- see the Examples section).
  12. Start Simplex using the commands listed below and in the Examples section.

Important parameters

The commands to use simplex has a number of required commands, as well as several optional commands (those in brackets):

     simplex file1 [-in2=file2] [-x=] [-y=] [-z=] [-t=] [-rolloff=] -compxyz=
     [-tstart=] -out=outfile -refwave=file#:refw -bkg= [-tol=] [-scale=]
     -alignwaves=al1f#:al1w:alf2#:al2w [-comparewaves=c1f#:cw1:c2f#:cw2]
     [-pass=p1f#:p1w:p2f#:p2w] [-norefout]
file1
Is the name of the file containing the image data.
-in2=file2
Is the name of the second, and optional, file with image data. The x, y, z, and time dimensions of the data must be compatible with those in file1.
-x=x_min:x_max -y=y_min:y_max -z=z_min:z_max -t=t_min:t_max:t_step
These options limit the data read in from the input files and analyzed by simplex. By default, the entire input dataset is used.
-rolloff=r
This is the width of the border, in microns, to rolloff. The default is no rolloff: r is zero.
-compxyz=x_min:x_max:y_min:y_max:z_min:z_max
This is the subregion of the image to use for r-factor calculation. This avoids image edge problems and must be supplied by user.
-tstart=x_trans:y_trans:z_trans
Is the starting translation to be applied before using simplex. The default is no translation (x_trans, y_trans, and z_trans are all zero).
-scale=s
Starting image intensity scale factor, where scale is used as: refint = compint/scale.
-bkg=ref_bkg:comp1_bkg:comp2_bkg...
Specifies the background value to subtract from the reference wavelength (the first value listed) and each of the compared wavelengths (the second value listed if for the first compare set, the third value for the second compare set, and so on). If there are fewer values than the number of compare sets plus one, the background for the remaining waves is zero.
-out=name
Specifies the name of the optional output file. When no output file is given, you just get the calculated alignment parameters written to the screen (or redirected to a file).
-tol=t
Specifies the r-factor tolerance in the simplex calculation. The default is t = 0.0001.
-refwave=ref_file:ref_wave
Selects the wavelength to be used as a reference. ref_file sets which of the two input files to use for the reference; use one for file1 and two for file2. ref_wave is the index of the reference wavelength in the file; it can range from zero, for the first wavelength, through four, for the last wavelength assuming that there are five wavelengths. The default is to use the first wavelength from file1 as the reference (i.e. equivalent to -refwave=1:0).
-alignwaves=a1_file:a1_wave:a2_file:a2_wave...
Specifies the wavelengths which are to be aligned to the reference wavelength. As with -refwave, each wavelength is specified by a file number and a wavelength index. The default is to use every wavelength except the one specified as the reference wavelength.
-comparewaves=c1_file:c1_wave:c2_file:c2_wave...
Specifies the wavelengths to compare to the reference wavelength in lieu of using the wavelengths to be aligned. The usage is the same as with -alignwaves. Each wavelength specified in this list is used in conjunction with the wavelength in the same position in the aligned wavelengths list. For example, use -alignwaves when you have bleedthrough data which is excited in the reference wave's excitation and recorded in the aligned wavelength's emission wavelengths. There must be the same number of wavelengths here as listed with -alignwaves! If you are using the same wavelength to align as you want saved, you need to rewrite it in the appropriate order if you need to specify bleedthroughs for other wavelengths. The default is to use the same list of wavelengths for the comparison waves as were set with -alignwaves.
-pass=p1_file:p1_wave:p2_file:p2_wave...
Specifies the wavelengths to pass to the output file without any processing. The waves are specified using the file number and the wavelength index just as they are in -alignwaves. The wavelengths passed without processing appear first in the output file after the reference wavelength (if it is output).
-norefout
If this option is supplied, the reference wavelength is not written to the output file. By default, the reference wavelength is written as the first wavelength in the output file.
-w
This option is accepted, but do not use it.

Examples

Simplex tends to run slowly so, if a queueing system available, you will want to make a script file as below to submit to a queue.

Sample header for file 1

  Number of columns, rows, sections ......   512   512   160
  Data organized (NZ,NW,NT) ..............    40     4     1 non-interleaved
  .
  .
  .
  # wavelengths, wavelengths (nm).........   4 540 605 675 460
      6 Titles :
  opf 40-48_cyc13.dat;ndo 40;exfilter fitc-w;ccd 3.0;exfilter rhod-w;ccd 3.0;
 exfilter cy5;ccd 7.0;exfilter dapi;ccd 3.0;foc 0.25;wait 2.0;enddo;clf;stop;
 Mon Apr  7 08:32:03 1997
 CCDCOR: CCD data correction V2.3 Norm=ON  Method=PHOTON COUNTER DATA
 Bleach=ON  Zline=ON
 DECON: DAA      0.1010    5    0.3050    1.0000   15    0.0029

Sample header for file 2

  Number of columns, rows, sections ......   512   512   160
  Data organized (NZ,NW,NT) ..............    40     2     1 non-interleaved
  .
  .
  .
  # wavelengths, wavelengths (nm).........   2 605 675
      6 Titles :
  opf 40-48_cyc13.dat;ndo 40;exfilter fitc-w;emfilter rhod-w;ccd 7.0;
 emfilter cy5;ccd 12.0;foc 0.25;wait 2.0;enddo;clf;stop;
 Mon Apr  8 09:27:17 1997
 CCDCOR: CCD data correction V2.3 Norm=ON  Method=PHOTON COUNTER DATA
 Bleach=ON  Zline=ON             
 DECON: DAA      0.1010    5    0.3050    1.0000   15    0.0029

Let's assume that from file 1, you want to use fitc-w (540) as your wavelength to align everything to, rhod-w (605) and cy5 (675) as the wavelengths to be aligned (i.e. they contain your data), and dapi(460) as a wavelength to be passed (as there is no means by which to align this data to the fitc-w wavelength). File 2 contains bleedthrough data of fitc-w excitation in the rhod-w (605) and cy5 (675) emission wavelengths. These can be used to align the corresponding emission wavelength data in file 1.

The script file would look something like (it is assumed the environment variable IVE_BASE is set to point to where Priism is installed, you could also explicitly replace $IVE_BASE with the path to the installation directory (i.e. /usr/local/ucsf_msg/IVE)):

#command file for simplex
setenv LD_LIBRARY_PATH $IVE_BASE/LIB_IRIX
( time $IVE_BASE/BIN_IRIX/simplex /usr/people/X/file1.dat_cor_decon \
 -in2=/usr/people/X/file2.dat_cor_decon -scale=1.0:1.0 \
 -compxyz=26:160:60:250:0:40 -refwave=1:0 -alignwaves=1:1:1:2 \
 -comparewaves=2:0:2:1 -pass=1:3 -bkg=0:0:0) \
 >& /usr/people/X/simplex.log

Helpful hints and notes