See the quick-start guide below to get started using UBSpec Processing.
CAAPP bitbucket account holders can access the latest source code here
pip install https://caapp-msu.bitbucket.io/projects/ubspec-processing/package.tar.gz --upgrade --no-cache-dir
pip install pandas
You will need to define the path to the directory containing traces, and the set of light intensities used.
Trace files for each light intensity will be located automatically, and you will be automaticaly prompted to enter the relevent meta-data
import ubspec_processing as ubs
folder = "path/to/data"
set_of_lights = [50,100,500,1000,2000]
processed_data = ubs.getAllPhotoDataFromOneFolder( folder, set_of_lights )
The code above can be easily adapted to process multiple folders by using ubs.getAllPhotoDataFromAllSubFolders()
instead of ubs.getAllPhotoDataFromOneFolder()
Processed results can be saved to CSV files using pandas. Meta-data will be included in CSVs.
import pandas
for header in processed_data.keys():
filename = header + ".csv"
print( "saving file \"" + filename + "\"" )
pandas.DataFrame.to_csv( data[header], filename )
This example assumes that your trace files follow "standard" naming conventions. However these settings (and others) can be changed by calling the functions shown below before getAllPhotoDataFromOneFolder()
or getAllPhotoDataFromAllSubFolders()
import ubspec_processing as ubs
ubs.setPS2LightTraceFileSuffix("_0002.dat") # (the default is "ue._aux_0002.dat")
ubs.setPS2DarkTraceFileSuffix("dat_0_0002.dat") # (the default is "f_aux_0002.dat")
ubs.setECSTraceFileSuffix("_0004.dat") # (the default is "ue.0003.dat")
Trace indices/loops should contain at least one pair of start,stop indices.
Trace aggregators effect how raw parameter loops are summarized for processing. Currently "min", "max", and "mean" are accepted.
import ubspec_processing as ubs
ubs.setPS2DarkTraceParameter( "F0", [ [45,54] ], "min" )
ubs.setPS2DarkTraceParameter( "Fm", [ [80,90], [95,104] ], "max" )
ubs.setPS2LightTraceParameter( "Fmp", [ [1330,1335], [1345,1354] ], "mean" )
raw parameters are divided into catagories based on the trace files they are extracted from
Catagory | Raw Parameters | Example Code |
---|---|---|
Photosystem 1 Dark | DarkP0, DarkPm | ubs.setPS1DarkTraceParameter( "DarkP0", [ [180,200] ], "mean" ) |
Photosystem 1 Light | P, P0, Pm, Pmp | ubs.setPS1LightTraceParameter( "P", [ [70,90] ], "mean" ) |
Photosystem 2 Dark | F0, Fm | ubs.setPS2DarkTraceParameter( "F0", [ [45,54] ], "mean" ) |
Photosystem 2 Light | Fmp, F0p, Fs, Fmpp, F0pp | ubs.setPS2LightTraceParameter( "Fmp", [ [1345,1354] ], "mean" ) |
Parsing | A, B, C | ubs.setParsingTraceParameter( "C", [ [30, 40] ], "max" ) |
These standard results are automatically computed if the necessary raw parameters are available.