waspLightPotentialVariableHighLightDuration1


Building a new RIDES_light_potential macro with integrated ECS. The concept for the protocol came out of discussions between myself and Gonzalo Estavillo during a PhotosynQ workshop (and subsequent beers). The idea is: what would be the instantaneous increase in LEF if the light intensity suddently increased to a certain point near saturation. To estmate this value, we started with RISES1_3_1 but in additiopn to the steady-state (ambient) light Fs valuies taken before the saturation pulse, we added a second, ~10-s illumination with 1000 uE. We assumed that the 10s was not sufficient change NPQ by a substantial amount, so that the Fv/FM' and NPQ parameters were taken with the sole saturation pulses. In this version, I added ECS measurements into the PAM fluorescence and P700 traces. The idea is to determine what the impact of suddenlyy increasing light on the pmf, which over the short interval should be moslty in the delta.PSI fraction. This is relevant to recent work in our lab on the FRIP (field-Recombination-Induced Photodamage), see (https://elifesciences.org/articles/16921 and tb.royalsocietypublishing.org/content/372/1730/20160381). Note: Special thanks to Sebastian Kuhlgert for the curve fitting routines! Some outputs are derived by fitting decay curves, e.g. the P700 and ECS data. The previous procedure, written by Kevin Bi and Greg Austic, though useful frequently failed. Fortunately, Sebastian added a really important new feature that allows for very flexible fitting that almost never fails.
/**
 * Macro for data evaluation of RIDES1_light_potential 
 * data on PhotosynQ.org
 * by: David M. Kramer 
 * created: 2017-05-09 @ 18:15:27      
 *                    
 * The concept for the protocol came out of discussions between myself
 * and Gonzalo Estavillo during a PhotosynQ workshop (and subsequent 
 * beers). The idea is: what would be the instantaneous increase in
 * LEF if the light intensity suddently increased to a certain point
 * near saturation. To estmate this value, we started with RISES1_3_1 
 * but in additiopn to the steady-state (ambient) light Fs valuies
 * taken before the saturation pulse, we added a second, ~10-s
 * illumination with 1000 uE. We assumed that the 10s was not sufficient 
 * change NPQ by a substantial amount, so that the Fv/FM' and NPQ
 * parameters were taken with the sole saturation pulses.
        
/* Note: Special thanks to Sebastian Kuhlgert for the curve fitting routines!
*     
* The following variables are for fitting the ECS decay curves when the 
* procedure written by Kevin and Greg often fails. Fortunately, Sebastian added 
* a really important new feature that allows for very flexible and useful 
* nonlinear curve fitting.    
*/       
  
// Define the output object here 
var output = {}; //dictionary to hold results
n_sets=json.set.length;
//output.n_sets=json.set.length;
var details=1;   
    
var DIRK_ECS=GetProtocolByLabel( "ecs_wasp", json, true ); 

var number_traces = DIRK_ECS.length;
var WASP_ECS_Decon=[];     
var ECS_only_traces=[];  
var ECS_w_WASP=[];  
var Fluor = [];
var Phi2=[];
var Phi2HighVals=[];
var Phi2LowVals=[];

var wasp_vals=[];
output.number_traces=number_traces; 
wasp_only_vals=[];

var wasp_only_traces=[];
var waspLOW_vals=[];
var waspHIGH_vals=[];
var wasp_over_Phi2_LOW =[];
var wasp_over_Phi2_HIGH =[];
var CEF_LEF=[];

var traceS =json.v_arrays[2];
var variableHighLightPulses=json.v_arrays[3];
output.traceS=traceS.join;
var length_of_baselines=20;

for (var i=0; i<number_traces; i++) {

var baseline_LOW_end=traceS[0];
var baseline_LOW_start=baseline_LOW_end-length_of_baselines; 
output.baseline_LOW_end=baseline_LOW_end;
output.baseline_LOW_start=baseline_LOW_start;

var sat_pulse_LOW_start=parseInt(traceS[0]) + 1;
var sat_pulse_LOW_end=parseInt(traceS[0]) + parseInt(traceS[1]);

output.sat_pulse_LOW_start=sat_pulse_LOW_start;
output.sat_pulse_LOW_end=sat_pulse_LOW_end;

var baseline_HIGH_end=parseInt(traceS[0])+parseInt(traceS[1])+parseInt(variableHighLightPulses[i]);

var baseline_HIGH_start=baseline_HIGH_end-length_of_baselines;

output.baseline_HIGH_end=baseline_HIGH_end;

output.traceS=traceS;

var sat_pulse_HIGH_end= baseline_HIGH_end + parseInt(traceS[3]);
var sat_pulse_HIGH_start=baseline_HIGH_end + 1;

output.sat_pulse_HIGH_end=sat_pulse_HIGH_end;
output.sat_pulse_HIGH_start=sat_pulse_HIGH_start;


//return output;   
  
//for (var i=0; i<number_traces; i++) {
   
    ECS_traces = DIRK_ECS[i].data_raw; 
    output.ECS_traces_composite=DIRK_ECS[i].data_raw;  
  
    ECS_WASP = ArrayNth( ECS_traces, 4, 1 );// sub trace with both the ECS and the WASP pulse (I, not A)
    output.ECS_WASP=ECS_WASP;
  	ECS_w_WASP.push(ECS_WASP);
    ECS_only = ArrayNth( ECS_traces, 4, 0 ); // sub trace with the ECS but NO WASP pulse (I, not A)
    output.ECS_only=ECS_only;
    WASP_only = ArrayNth( ECS_traces, 4, 2 ); // sub trace with WASP but NO ECS pulse (I, not A)
    output.WASP_only=WASP_only;
  	wasp_only_traces.push(WASP_only);
    wasp_only_vals.push( MathMEAN(WASP_only.slice(3,29))-MathMEAN(WASP_only.slice(31,59)));
    var FLUOR = ArrayNth( ECS_traces, 4, 3 ); // sub trace with WASP but NO ECS pulse (I, not A)
    output.FLUOR=FLUOR;
    Fluor.push(FLUOR); 
	output.bleed=DIRK_ECS[i].bleed;
	output.wasp_only_traces=wasp_only_traces;
  
  output.XXXX=TransformTrace("subtract", ECS_WASP, ECS_only);
   
  output.wasp_only_vals=wasp_only_vals;
    
    var ECS_WASP_m_WASP = TransformTrace( "subtract", ECS_WASP, WASP_only); //ECS_wasp_diff, ECS_no_wasp);
    output.ECS_WASP_m_WASP=ECS_WASP_m_WASP;  // difference between the trace with ECS and WASP and just the WASP 
                                             // should get rid of the WASP component,
                                             // leaving only the ECS with the actinic effect of the WASP pulse
     
    var ECS_WASP_m_ECS_only = TransformTrace( "subtract", ECS_only,ECS_WASP_m_WASP ); //ECS_wasp_diff, ECS_no_wasp);
                                            // Differnece between the corrected ECS trace that
                                            // has actinic effect of WASP and the trace with 
                                            // no WASP actinic. This means that
                                            // if the WASP pulse induces an increase
                                            // in ECS (by inducing charge separation)
                                            // the increase in absorbance should decrease
                                            // the ECS_WASP_m_ECS_only signal. 
	output.ECS_WASP_m_ECS_only=ECS_WASP_m_ECS_only; 
     
  var baseline = MathMEAN(ECS_WASP_m_ECS_only.slice(baseline_LOW_start,baseline_LOW_end) );
  output.baseline=baseline;
  
      
  	ECS_WASP_m_ECS_only = TransformTrace( "subtract", ECS_WASP_m_ECS_only, baseline);
    output["ECS_WASP_m_ECS_only:" + i]=ECS_WASP_m_ECS_only; 
 //	ECS_WASP_m_ECS_only[0]=0; 
 //	ECS_WASP_m_ECS_only[30]=0;  
 // 	ECS_WASP_m_ECS_only[60]=0;  
      
  WASP_ECS_Decon.push(ECS_WASP_m_ECS_only);  
  // calculate the WASP for the LOW light case 
  var wasp_ss=MathMEAN(ECS_WASP_m_ECS_only.slice(baseline_LOW_start,baseline_LOW_end)); 
  output.YYYYYY=wasp_ss;
  var wasp_sp=MathMEAN(ECS_WASP_m_ECS_only.slice(sat_pulse_LOW_start,sat_pulse_LOW_end)); 
  var waspLOW=MathROUND(wasp_ss-wasp_sp,3);  
  output.waspLOW=waspLOW;
  waspLOW_vals.push(MathROUND(waspLOW,3)); //    

   // calculate the WASP for the HIGH light case 
  var wasp_ss=MathMEAN(ECS_WASP_m_ECS_only.slice(baseline_HIGH_start,baseline_HIGH_end));
  var wasp_sp=MathMEAN(ECS_WASP_m_ECS_only.slice(sat_pulse_HIGH_start,sat_pulse_HIGH_end)); 
  var waspHIGH=MathROUND(wasp_ss-wasp_sp,3); 
  output.waspHIGH=waspHIGH;
  waspHIGH_vals.push(MathROUND(waspHIGH,3)); //    

  var b = ECS_only[0]; 
  var ECS_only_m_b=TransformTrace( "subtract", ECS_only, b); 
  ECS_only_traces.push(ECS_only);
  var Fs=MathMEAN(FLUOR.slice(baseline_LOW_start,baseline_LOW_end));
  var Fmp=MathMAX(FLUOR.slice(sat_pulse_LOW_start,sat_pulse_LOW_end));
  var Phi2Low= MathROUND((Fmp-Fs)/Fmp,3);
  output.Phi2Low=Phi2Low;
  Phi2.push(MathROUND(Phi2Low,3)); 
  Phi2LowVals.push(MathROUND(Phi2Low,3));

  var Fs=MathMEAN(FLUOR.slice(baseline_HIGH_start,baseline_HIGH_end));
  var Fmp=MathMAX(FLUOR.slice(sat_pulse_HIGH_start,sat_pulse_HIGH_end));
  var Phi2High= MathROUND((Fmp-Fs)/Fmp,3);
  output.Phi2High=MathROUND(Phi2High); 
  Phi2HighVals.push(MathROUND(Phi2High));
  
  Phi2.push(MathROUND(Phi2Low,3));
  output.wasp_phi2_LOW = MathROUND(waspLOW/Phi2Low,2);
  output.wasp_phi2_HIGH = MathROUND(waspHIGH/Phi2High,2);
  wasp_over_Phi2_LOW.push(MathROUND(waspLOW/Phi2Low,2));
  wasp_over_Phi2_HIGH.push(MathROUND(waspHIGH/Phi2High,2));
  CEF_LEF.push((waspHIGH/Phi2High)/(waspLOW/Phi2Low));
} 
 
output.Phi2LowVals=Phi2LowVals;  
output.Phi2HighVals=Phi2HighVals;
output.waspLow_vals=waspLOW_vals;
output.waspHIGH_vals=waspHIGH_vals;
 
output.wasp_over_Phi2_LOW=wasp_over_Phi2_LOW;
output.wasp_over_Phi2_HIGH=wasp_over_Phi2_HIGH;
output.CEF_LEF=CEF_LEF;

output.WASP_ECS_Decon=WASP_ECS_Decon;  
output.ECS_only_traces=ECS_only_traces;
output.ECS_w_WASP=ECS_w_WASP;
output.Fluor=Fluor;

output.wasp=wasp_vals;
output.wasp_vals=".append([" + wasp_vals.join() + "])";

output.wasp_cor=[];

for (var i=0; i<wasp_vals.length;i++){
  output.wasp_cor.push(MathROUND(wasp_vals[i]-wasp_only_vals[i],2));
}

output.Phi2=Phi2;
output.zPhi2vals=".append([" + Phi2.join() + "])";

output.wasp_corr=".append([" + output.wasp_cor.join() + "])";

output.zpython="{";
output.zpython += "\"Phi2\":[" + Phi2.join() + "]";
output.zpython += ",\"wasp_vals\":[" + wasp_vals.join() + "]";
output.zpython += ",\"wasp_corr\":[" + output.wasp_cor.join() + "]";

output.zpython += "}";

return output;
{
  "time": 1548453277543,
  "device_name": "MultispeQ",
  "device_version": "2",
  "device_id": "32:11:48:18",
  "device_battery": 106,
  "device_firmware": 2.0091,
  "sample": [
    [
      {
        "time": 1548453277543,
        "v_arrays": [
          [
            "30",
            "20",
            "40",
            "80",
            "160",
            "320",
            "640",
            "1280",
            "640",
            "320",
            "160",
            "80",
            "40",
            "20"
          ],
          [
            "600",
            "-3000",
            "10",
            "1",
            "6"
          ],
          [
            "100",
            "20",
            "100",
            "20",
            "30"
          ],
          [
            "20",
            "30",
            "50",
            "80",
            "100",
            "80",
            "50",
            "30",
            "20",
            "20",
            "30",
            "50",
            "80",
            "100",
            "80",
            "50",
            "30",
            "20"
          ]
        ],
        "set_repeats": 1,
        "protocol_id": 1,
        "set": [
          {
            "time": 1548453277576,
            "autogain": [
              [
                10,
                1,
                10,
                -4506,
                16566
              ]
            ],
            "data_raw": [

            ]
          },
          {
            "time": 1548453278728,
            "label": "ecs_wasp",
            "pre_illumination": [
              2,
              30,
              600
            ],
            "data_raw": [
              16552,
              14461,
              569,
              1571,
              16563,
              14441,
              568,
              1624,
              16559,
              14431,
              575,
              1684,
              16553,
              14411,
              575,
              1733,
              16565,
              14401,
              572,
              1789,
              16560,
              14391,
              577,
              1847,
              16557,
              14379,
              571,
              1895,
              16559,
              14371,
              570,
              1953,
              16557,
              14349,
              564,
              2014,
              16561,
              14344,
              569,
              2083,
              16556,
              14338,
              565,
              2147,
              16557,
              14327,
              562,
              2211,
              16555,
              14321,
              570,
              2273,
              16563,
              14308,
              565,
              2335,
              16565,
              14300,
              565,
              2399,
              16556,
              14291,
              558,
              2451,
              16559,
              14293,
              559,
              2505,
              16561,
              14289,
              561,
              2543,
              16565,
              14291,
              563,
              2581,
              16567,
              14281,
              562,
              2604,
              16563,
              14279,
              561,
              2624,
              16559,
              14275,
              563,
              2623,
              16564,
              14277,
              557,
              2613,
              16561,
              14279,
              561,
              2605,
              16565,
              14274,
              562,
              2580,
              16556,
              14288,
              561,
              2550,
              16568,
              14289,
              562,
              2517,
              16569,
              14291,
              560,
              2485,
              16561,
              14286,
              563,
              2451,
              16568,
              14297,
              566,
              2429,
              16564,
              14299,
              570,
              2397,
              16567,
              14316,
              561,
              2370,
              16558,
              14315,
              563,
              2343,
              16564,
              14317,
              564,
              2322,
              16561,
              14319,
              565,
              2309,
              16563,
              14327,
              561,
              2287,
              16562,
              14331,
              556,
              2284,
              16561,
              14331,
              564,
              2274,
              16562,
              14333,
              563,
              2269,
              16561,
              14340,
              559,
              2263,
              16560,
              14340,
              559,
              2259,
              16559,
              14345,
              564,
              2257,
              16560,
              14337,
              561,
              2261,
              16557,
              14341,
              561,
              2263,
              16555,
              14339,
              561,
              2267,
              16556,
              14341,
              557,
              2273,
              16557,
              14341,
              560,
              2277,
              16565,
              14345,
              561,
              2280,
              16561,
              14341,
              556,
              2285,
              16564,
              14336,
              554,
              2300,
              16551,
              14333,
              559,
              2298,
              16565,
              14333,
              557,
              2309,
              16558,
              14340,
              560,
              2317,
              16561,
              14338,
              556,
              2321,
              16559,
              14347,
              556,
              2329,
              16564,
              14337,
              557,
              2332,
              16564,
              14335,
              559,
              2337,
              16563,
              14335,
              557,
              2341,
              16558,
              14331,
              549,
              2347,
              16559,
              14327,
              553,
              2353,
              16565,
              14333,
              554,
              2349,
              16557,
              14338,
              556,
              2357,
              16560,
              14343,
              556,
              2354,
              16565,
              14343,
              552,
              2357,
              16563,
              14337,
              555,
              2361,
              16556,
              14335,
              552,
              2357,
              16562,
              14337,
              554,
              2365,
              16557,
              14341,
              549,
              2365,
              16557,
              14339,
              555,
              2362,
              16567,
              14340,
              553,
              2361,
              16563,
              14348,
              555,
              2359,
              16561,
              14347,
              557,
              2354,
              16563,
              14343,
              547,
              2353,
              16553,
              14338,
              557,
              2351,
              16554,
              14347,
              549,
              2341,
              16557,
              14345,
              553,
              2348,
              16556,
              14349,
              554,
              2343,
              16556,
              14355,
              547,
              2339,
              16552,
              14359,
              555,
              2326,
              16561,
              14357,
              551,
              2320,
              16557,
              14352,
              553,
              2320,
              16555,
              14357,
              549,
              2315,
              16551,
              14365,
              547,
              2311,
              16556,
              14362,
              553,
              2300,
              16560,
              14367,
              553,
              2297,
              16554,
              14369,
              553,
              2289,
              16563,
              14371,
              551,
              2280,
              16559,
              14376,
              553,
              2277,
              16561,
              14375,
              554,
              2270,
              16557,
              14379,
              551,
              2259,
              16559,
              14380,
              555,
              2252,
              16557,
              14384,
              548,
              2244,
              16563,
              14383,
              553,
              2237,
              16553,
              14389,
              553,
              2233,
              16560,
              14393,
              549,
              2220,
              16553,
              14397,
              548,
              2217,
              16549,
              14395,
              551,
              2208,
              16557,
              14400,
              551,
              2205,
              16558,
              14399,
              547,
              2196,
              16557,
              14399,
              549,
              2185,
              16955,
              14561,
              526,
              3389,
              16939,
              14549,
              521,
              3389,
              16937,
              14547,
              527,
              3391,
              16941,
              14547,
              526,
              3384,
              16931,
              14549,
              524,
              3385,
              16931,
              14545,
              526,
              3372,
              16924,
              14551,
              519,
              3356,
              16929,
              14548,
              529,
              3337,
              16924,
              14547,
              526,
              3321,
              16923,
              14543,
              524,
              3291,
              16921,
              14552,
              526,
              3277,
              16917,
              14541,
              521,
              3245,
              16912,
              14549,
              531,
              3225,
              16907,
              14548,
              528,
              3202,
              16909,
              14551,
              527,
              3170,
              16908,
              14553,
              526,
              3144,
              16899,
              14549,
              523,
              3118,
              16895,
              14563,
              531,
              3095,
              16894,
              14559,
              523,
              3069,
              16891,
              14567,
              523,
              3037,
              16576,
              14386,
              544,
              2522,
              16578,
              14422,
              538,
              2432,
              16581,
              14447,
              540,
              2362,
              16575,
              14464,
              543,
              2295,
              16576,
              14490,
              543,
              2235,
              16579,
              14504,
              538,
              2182,
              16579,
              14532,
              535,
              2143,
              16573,
              14540,
              534,
              2101,
              16576,
              14555,
              538,
              2062,
              16574,
              14564,
              540,
              2032,
              16574,
              14578,
              536,
              1991,
              16576,
              14586,
              536,
              1968,
              16568,
              14592,
              536,
              1951,
              16571,
              14596,
              538,
              1925,
              16567,
              14615,
              535,
              1910,
              16568,
              14616,
              535,
              1888,
              16566,
              14623,
              541,
              1874,
              16564,
              14626,
              535,
              1856,
              16568,
              14637,
              534,
              1838,
              16560,
              14640,
              532,
              1830,
              16803,
              14780,
              528,
              2045,
              16791,
              14776,
              521,
              2041,
              16793,
              14771,
              531,
              2040,
              16795,
              14771,
              527,
              2027,
              16790,
              14772,
              532,
              2027,
              16789,
              14777,
              528,
              2017,
              16788,
              14767,
              523,
              2015,
              16785,
              14774,
              525,
              2003,
              16785,
              14770,
              525,
              1997,
              16776,
              14780,
              525,
              1989,
              16782,
              14771,
              524,
              1981,
              16779,
              14777,
              525,
              1971,
              16780,
              14769,
              527,
              1969,
              16779,
              14777,
              529,
              1960,
              16780,
              14769,
              529,
              1958,
              16779,
              14777,
              526,
              1947,
              16780,
              14773,
              529,
              1941,
              16776,
              14781,
              525,
              1931,
              16781,
              14783,
              526,
              1923,
              16777,
              14781,
              525,
              1917,
              16559,
              14671,
              542,
              1565,
              16557,
              14685,
              537,
              1523,
              16555,
              14693,
              538,
              1503,
              16557,
              14699,
              541,
              1489,
              16557,
              14704,
              540,
              1477,
              16559,
              14711,
              541,
              1469,
              16557,
              14715,
              538,
              1464,
              16555,
              14713,
              541,
              1460,
              16558,
              14719,
              536,
              1457,
              16555,
              14715,
              534,
              1448,
              16551,
              14718,
              540,
              1447,
              16561,
              14721,
              537,
              1443,
              16559,
              14729,
              543,
              1433,
              16557,
              14733,
              543,
              1431,
              16553,
              14733,
              535,
              1428,
              16555,
              14733,
              547,
              1423,
              16561,
              14737,
              540,
              1419,
              16555,
              14732,
              539,
              1417,
              16557,
              14746,
              538,
              1409,
              16551,
              14746,
              538,
              1405,
              16555,
              14752,
              541,
              1407,
              16557,
              14751,
              540,
              1402,
              16557,
              14753,
              541,
              1397,
              16556,
              14753,
              540,
              1395,
              16553,
              14757,
              541,
              1393,
              16562,
              14759,
              540,
              1387,
              16556,
              14759,
              539,
              1385,
              16557,
              14767,
              539,
              1379,
              16555,
              14767,
              538,
              1380,
              16556,
              14765,
              544,
              1370
            ]
          }
        ],
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "macOS 16.7.0",
  "app_name": "PhotosynQ",
  "app_version": "1.0.4",
  "app_device": "x64",
  "location": false,
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
2
Latest Update:
Jan 2019