rstoolbox.io.read_SPR

rstoolbox.io.read_SPR(filename)

Reads Surface Plasmon Resonance data.

The input data should be a comma-separated file with two types of header, one for raw data:

Run 1; Ch 1; Cy 6; RefSub; name; conc=0.0585_X ,...

And one for fitted data:

Run 1; Ch 1; Cy 16; RefSub; 1kx8_d02; conc=60 fitted curve_X ,...

each conc condition will have a _X and _Y value.

This seems to be a pretty standard format as output from the machine.

Tip

The provided DataFrame will actually be casted to SPRFrame. This class has no other purpose that identification to help other library functions and, thus, works as a normal DataFrame.

Parameters:filename (str) – Input file.
Returns:DataFrame with MultiIndex.

See also

plot_SPR()

Example

In [1]: from rstoolbox.io import read_SPR
   ...: import pandas as pd
   ...: pd.set_option('display.width', 1000)
   ...: pd.set_option('display.max_columns', 500)
   ...: df = read_SPR("../rstoolbox/tests/data/spr_data.csv.gz")
   ...: df.head(2)
   ...: 
Out[1]: 
data                 raw                                                                                                                                                                                                                           fitted                                                                     
concentration     0.0585                0.117             0.234375              0.46875               0.9375              1.875               3.75                7.5                   15                   30                   60                 3.75             7.5              15              30              60     
axis                   X         Y          X         Y          X         Y          X         Y          X       Y          X       Y          X       Y          X         Y          X         Y          X         Y          X         Y          X    Y          X    Y          X    Y          X    Y          X    Y
0             -37.400002 -0.011209 -37.300003  0.284098 -37.300003  0.190698 -37.200001  0.159199 -37.100002  0.3337 -37.000000  0.2639 -37.000000  0.2056 -36.900002  0.176199 -36.900002  0.330999 -36.900002  0.119499 -36.900002  0.218399 -37.000000  0.0 -36.900002  0.0 -36.900002  0.0 -36.900002  0.0 -36.900002  0.0
1             -37.299999 -0.117500 -37.200001  0.073299 -37.200001 -0.034101 -37.099998  0.013600 -37.000000 -0.0063 -36.899998  0.0813 -36.899998  0.1044 -36.799999  0.013100 -36.799999  0.090100 -36.799999 -0.051800 -36.799999  0.146300 -36.950001  0.0 -36.850002  0.0 -36.850002  0.0 -36.850002  0.0 -36.850002  0.0