MATRIX INVERSION
(MI.xltm)

This program corrects for spillover between fluorescent colors present in a
common sample using a matrix inversion technique.

The file is saved as a macro-enabled Excel template (.xltm). Copy this
file to Microsoft's My Template directory. On a Mac, this should be
found in:
 ~/Library/Application Support/Microsoft/Office/User Templates/My Templates

Once in the template directory, a new file can be opened from the Excel
menu using File->New from Template.

Restrictions:
- Number of colors:  2-10.
- There must be three worksheets present entitled "Matrix", "Input Data", and
  "Output Data".  Matrix has hidden formulas in many cells so do not use the
  Clear All command as this will also erase the formulas.
	
INPUT

WORKSHEET "Matrix" 

  # Colors

  Enter the number of fluorescent colors (n) in your sample(s) in cell A2.
  After entry headers appear on row 1 for colors 1 through n.  While not 
  required the color identifiers entered on row 2 are then used in the 
  worksheets to identify the colors sampled.

  Note that areas for user data entry on the main sheet are tinted with
  a light blue background. Other parts of this sheet are protected from
  the user.

  Pure Samples

  To determine the correction required you must supply results of readings on 
  pure samples for each color present.  This determines the amount of 
  spillover present in the wavelengths for other colors when only a pure 
  sample is present.  If you are analyzing samples with 4 colors in it, you 
  must supply a 4 x 4 matrix of readings of pure samples (see below).  These 
  must be present in ascending order of excitation wavelength and the order of 
  colors on the pure samples must match the output of the analysis samples. 

  Table 1:

  # of colors  Color 1       Color 2       Color 3       Color 4
      4          green        yellow           red       carmine 

  Pure Samples
                 green        yellow           red       carmine 
     1         217.744         0.448         0.357         0.000
     2           0.345      1599.816         0.480         0.124
     3           0.202         0.756       704.273         5.477
     4           0.154         0.230         2.357       205.523

Once the pure samples are entered both the spillover and matrix inversion
matrices are calculated.

  Spillover					
                 green        yellow           red       carmine 
                  1.00	        0.00          0.00          0.00
                  0.00          1.00          0.00          0.00
                  0.00          0.00          1.00          0.01
                  0.00          0.00          0.01          1.00

  Inverted Matrix			
                 green        yellow           red       carmine 			
           1.000000904  -0.002055719  -0.001639073   1.29061E-05
          -0.000215508   1.000000848  -0.000298819  -7.51851E-05
          -0.000280789  -0.001064263   1.000089974  -0.007777431
          -0.000745847  -0.001105351  -0.011467772   1.000089268

WORKSHEET "Input Data"

  Row 1 must not be overwritten as the program expects identifiers on that 
  row.  Data is entered starting in row 2, making certain that the data in 
  each column matches the identifier at the top of that column.  The number of 
  samples to be analyzed is limited only by the number of rows Excel can 
  handle.

  ANALYSIS

  Run the "CorrectData macro" using either the Correct Data button on
  the main sheet or found under Tools>Macro>Macros.  Corrected
  data will be written on the "Output Data" worksheet.  The Corrected
  Samples below are generated from the spillover matrix presented above
  if you wish to confirm functionality of the program.

  Data				
  Sample #				
     1             456           753           268          486
     2             356           456           162          789
     3             235           265           896          635
     4             561           874           562          324
     5             895           465           157          369
     6             325           489           761          485

  Corrected				
  Sample #				
     1          455.40        751.24        261.48       483.91
     2          355.27        454.22        152.25       787.78
     3          234.22        262.86        888.33       628.07
     4          560.41        871.89        557.15       319.60
     5          894.58        462.59        151.18       367.79
     6          324.32        486.99        754.83       479.09

BUTTONS

    1) Correct Data - runs the Correct Data macro. It reads Input Data
    and the inverted matrix.
    
    2) Clear Data - clears both Input and Output data. There are
    separate macros for the clear commands that can be accessed from the
    Tools->Macros->Macros menu.

    3) Clear Matrix - this will clear the number of colors, their color
    names and any data input into the Pure Samples area.
    
FEEDBACK

We always appreciate hearing from users of our software.  Please let us know
both good and bad experiences using this spreadsheet.  You can contact us at:

Melissa Krueger krueger@u.washington.edu
Robb Glenny	    glenny@u.washington.edu

