Proton Motive Force via DIRK II new - RG v1


Estimates the proton motive force through the ATP synthase, thereby estimating ATP production. The proton motive force is measured by measuring the electrochromic shift (ECS), the shift in the absorbance of chlorophyll at ~520nm in the thylakoid membrane due to a shift in the electric field. The electric field is created by the accumulation of hydrogen ions (H+) in the thylakoid, causing an electric field to be produced between the inside and outside of the thylakoid membrane. This measurement applies the ambient light level in the chamber to the sample, then shuts off the light, causing the intensity of the electric field to drop as the H+ ions drain from the thylakoid. This drop in electric field intensity is detected by the measuring light at 520nm. The method is called DIRK - Dark Induced Relaxation Kinetics. The size of the change in the electric field (and therefore 520 signal) is an indicator of the quantity of H+ ions which had accumulated in the thylakoid. The rate at which the electric field changes indicates the capacity of ATP synthase to release H+ from the thylakoid membrane.
// The measures DIRK ECS using on-off-on actinic, with actinic pulled from the PAR sensor.  This measurement smooths out the dark period by using a 2 layer smoothing.
// should I calibrate this to a 940 signal, to estimate thickness?

var output = {};
var spad;

var vhplus;
var tau;
var ECSt;
var quality_flag = 0;
var i = 0;
var j = 0;
var h = 0;
var k = 0;

// This is the area which needs to be smoothed out,  the _abs version will be absorbance values
var smooth1 = json.data_raw.slice(300,600);
var smooth1_abs = [];

// points 300 and 301 can be affected by electronic blips, so we set them == to the average of the previous 'on' values
var fixit = MathMEAN(json.data_raw.slice(230,290));
smooth1[0] = fixit;
smooth1[1] = fixit;

// create an rolling average for every 2 measurements.  Then repeat with ever 3.  Then 4, etc.  Then repeat that process 5 times.

var tbsmooth = 0;

///*
// first just smooth out the big bumps
for (k=0;k<15;k++) {
  for (h=2;h<3;h++) {
    for (j=1;j<296;j++) {
      tbsmooth = 0;
      for (i=0;i<h;i++) {
        tbsmooth += smooth1[i+j];  // sum current point + next point
      }
      smooth1[j] = MathROUND(tbsmooth/h,0);
    }
  }
}

// then roll out the kinks
for (k=0;k<7;k++) {
  for (h=2;h<5;h++) {
    for (j=1;j<296;j++) {
      tbsmooth = 0;
      for (i=0;i<h;i++) {
        tbsmooth += smooth1[i-1+j];  // sum previous 1 point + next h-1 point(s)
      }
      smooth1[j] = MathROUND(tbsmooth/h,0);
    }
  }
}
//*/

// now convert smooth1 into absorbance ( abs = log(Is / I0) )
for (var x=0;x<300;x++) {
  smooth1_abs[x] = MathLOG(smooth1[x]/smooth1[0]);
}


// calculate ECSt
max = MathMEAN(smooth1_abs.sort().slice(10,299));
var min = smooth1_abs[0];
ECSt = max - min;

// Calculate GH+ by finding the 1/e point in the dark period
var tmpval;
var howclose_e = 1;
var tmpslope = 0;
var close_e = [];
var slope_e = [];
for (k=0;k<299;k++) {
  tmpval = (smooth1_abs[k]-min)/(max-min);
  howclose_e = (1/Math.E - tmpval);
  close_e[k] = MathROUND((1/Math.E - tmpval),3);
  // if slope is largest, then choose it for vhplus up to tau
  if (((smooth1_abs[k+1]-min)/(max-min) - tmpval) > tmpslope) {
    vhplus = (smooth1_abs[k+1]-min)/(max-min) - tmpval;
  }
  tmpslope = (smooth1_abs[k+1]-min)/(max-min) - tmpval;
  slope_e[k] = MathROUND((smooth1_abs[k+1]-min)/(max-min) - tmpval,4);
  // once you hit tau, then stop iterating
  if (howclose_e < 0) {
    tau = (smooth1_abs[k]-min)/(max-min);
    break;
  }
}

// Check for quality issues
// issue 1: large standard deviation in the first 'on' period
var st_dev_on = MathSTDEV(json.data_raw.slice(20,290));
if (st_dev_on > 50) {
  quality_flag++;
}

if (quality_flag > 0) {
  output ["quality flag"] = quality_flag;
  output ["st_dev_on"] = MathROUND(st_dev_on,0);
}

//output ["log out"] = smooth1_abs;
output ["ECSt"] = MathROUND(ECSt,4);
output ["vhplus"] = MathROUND(vhplus,4);
output ["ghplus"] = 1/MathROUND(tau,4);
//output ["close_e"] = close_e;
//output ["slope_e"] = slope_e;
//output ["smooth1"] = smooth1;


return output;
{
  "time_offset": 300,
  "time": 1423417849678,
  "device_id": 91,
  "firmware_version": "0.370",
  "sample": [
    [
      {
        "time": 1423417849678,
        "protocol_id": 1,
        "averages": 4,
        "data_raw": [
          28822,
          38432,
          38410,
          38431,
          38443,
          38413,
          38428,
          38449,
          38434,
          38408,
          38410,
          38449,
          38434,
          38416,
          38461,
          38476,
          38428,
          38416,
          38426,
          38421,
          38437,
          38438,
          38440,
          38427,
          38458,
          38390,
          38442,
          38415,
          38440,
          38455,
          38458,
          38415,
          38443,
          38453,
          38437,
          38480,
          38436,
          38477,
          38435,
          38482,
          38459,
          38452,
          38450,
          38438,
          38468,
          38455,
          38451,
          38431,
          38479,
          38440,
          38425,
          38463,
          38458,
          38460,
          38449,
          38474,
          38453,
          38457,
          38454,
          38437,
          38462,
          38461,
          38425,
          38446,
          38462,
          38462,
          38462,
          38449,
          38448,
          38425,
          38436,
          38496,
          38490,
          38453,
          38463,
          38471,
          38445,
          38462,
          38435,
          38483,
          38476,
          38447,
          38466,
          38443,
          38470,
          38444,
          38505,
          38445,
          38469,
          38427,
          38461,
          38436,
          38440,
          38420,
          38436,
          38413,
          38488,
          38444,
          38475,
          38454,
          38440,
          38461,
          38465,
          38461,
          38464,
          38471,
          38477,
          38445,
          38392,
          38474,
          38470,
          38472,
          38464,
          38428,
          38443,
          38473,
          38481,
          38463,
          38474,
          38455,
          38440,
          38432,
          38458,
          38427,
          38445,
          38469,
          38460,
          38460,
          38444,
          38455,
          38464,
          38428,
          38434,
          38487,
          38456,
          38457,
          38467,
          38444,
          38479,
          38462,
          38457,
          38504,
          38483,
          38450,
          38457,
          38442,
          38419,
          38462,
          38449,
          38443,
          38480,
          38481,
          38486,
          38468,
          38444,
          38487,
          38475,
          38464,
          38473,
          38481,
          38458,
          38456,
          38439,
          38445,
          38502,
          38473,
          38467,
          38462,
          38495,
          38487,
          38488,
          38445,
          38509,
          38466,
          38478,
          38445,
          38453,
          38464,
          38485,
          38472,
          38496,
          38452,
          38454,
          38499,
          38460,
          38461,
          38475,
          38454,
          38519,
          38491,
          38437,
          38453,
          38491,
          38504,
          38522,
          38458,
          38462,
          38454,
          38498,
          38465,
          38483,
          38486,
          38460,
          38480,
          38492,
          38474,
          38463,
          38488,
          38492,
          38484,
          38501,
          38449,
          38475,
          38481,
          38465,
          38494,
          38452,
          38491,
          38469,
          38471,
          38470,
          38514,
          38464,
          38486,
          38440,
          38478,
          38453,
          38467,
          38489,
          38476,
          38470,
          38497,
          38445,
          38478,
          38488,
          38472,
          38457,
          38456,
          38471,
          38445,
          38497,
          38492,
          38482,
          38509,
          38475,
          38466,
          38490,
          38468,
          38494,
          38451,
          38470,
          38463,
          38475,
          38476,
          38521,
          38493,
          38492,
          38497,
          38477,
          38471,
          38457,
          38482,
          38463,
          38467,
          38502,
          38440,
          38460,
          38470,
          38492,
          38466,
          38454,
          38454,
          38485,
          38471,
          38482,
          38465,
          38477,
          38461,
          38490,
          38515,
          38470,
          38490,
          38486,
          38487,
          38478,
          38483,
          38496,
          38500,
          38438,
          38462,
          38488,
          38499,
          38460,
          38496,
          38481,
          38480,
          38519,
          38486,
          38487,
          38503,
          38013,
          38375,
          38485,
          38516,
          38553,
          38565,
          38527,
          38537,
          38544,
          38550,
          38591,
          38572,
          38605,
          38586,
          38566,
          38588,
          38590,
          38621,
          38611,
          38636,
          38643,
          38588,
          38641,
          38616,
          38648,
          38657,
          38649,
          38664,
          38652,
          38668,
          38644,
          38628,
          38644,
          38677,
          38637,
          38639,
          38659,
          38636,
          38658,
          38674,
          38676,
          38655,
          38666,
          38671,
          38620,
          38635,
          38651,
          38625,
          38660,
          38670,
          38678,
          38666,
          38657,
          38667,
          38658,
          38669,
          38682,
          38684,
          38685,
          38643,
          38646,
          38664,
          38665,
          38671,
          38688,
          38665,
          38674,
          38659,
          38691,
          38658,
          38686,
          38649,
          38673,
          38660,
          38675,
          38682,
          38656,
          38610,
          38674,
          38658,
          38701,
          38668,
          38683,
          38648,
          38647,
          38683,
          38658,
          38703,
          38700,
          38686,
          38711,
          38667,
          38668,
          38692,
          38702,
          38699,
          38683,
          38670,
          38666,
          38661,
          38698,
          38702,
          38655,
          38693,
          38693,
          38675,
          38670,
          38669,
          38689,
          38660,
          38675,
          38702,
          38684,
          38680,
          38684,
          38688,
          38644,
          38692,
          38697,
          38693,
          38696,
          38654,
          38685,
          38669,
          38681,
          38688,
          38676,
          38646,
          38688,
          38667,
          38655,
          38701,
          38625,
          38693,
          38683,
          38652,
          38662,
          38645,
          38672,
          38667,
          38693,
          38698,
          38646,
          38675,
          38657,
          38676,
          38697,
          38673,
          38674,
          38651,
          38681,
          38674,
          38649,
          38683,
          38646,
          38685,
          38648,
          38690,
          38675,
          38652,
          38674,
          38671,
          38678,
          38672,
          38666,
          38633,
          38703,
          38686,
          38653,
          38653,
          38680,
          38683,
          38665,
          38662,
          38663,
          38654,
          38650,
          38664,
          38692,
          38686,
          38655,
          38660,
          38633,
          38677,
          38667,
          38654,
          38679,
          38669,
          38653,
          38660,
          38642,
          38669,
          38666,
          38654,
          38673,
          38650,
          38672,
          38654,
          38656,
          38655,
          38651,
          38668,
          38667,
          38678,
          38659,
          38697,
          38640,
          38677,
          38673,
          38681,
          38686,
          38616,
          38682,
          38672,
          38653,
          38663,
          38680,
          38616,
          38648,
          38689,
          38678,
          38683,
          38688,
          38648,
          38671,
          38683,
          38662,
          38659,
          38643,
          38650,
          38635,
          38716,
          38678,
          38686,
          38658,
          38658,
          38678,
          38695,
          38667,
          38664,
          38656,
          38683,
          38677,
          38674,
          38679,
          38675,
          38689,
          38657,
          38676,
          38654,
          38699,
          38665,
          38693,
          38607,
          38660,
          38669,
          38667,
          38629,
          38670,
          38656,
          38653,
          38668,
          38664,
          38667,
          38641,
          38707,
          38683,
          38674,
          38673,
          38687,
          38650,
          38634,
          38667,
          38640,
          38652,
          38657,
          38650,
          38645,
          38690,
          38644,
          38678,
          38663,
          38681,
          38681,
          38681,
          38650,
          38703,
          38655,
          38653,
          38700,
          38694,
          38679,
          38687,
          38664,
          38696,
          38680,
          38679,
          38660,
          38660,
          38675,
          38120,
          38784,
          38635,
          38648,
          38612,
          38641,
          38612,
          38583,
          38567,
          38588,
          38588,
          38619,
          38587,
          38564,
          38591,
          38598,
          38560,
          38593,
          38579,
          38578,
          38597,
          38590,
          38581,
          38578,
          38599,
          38564,
          38561,
          38583,
          38582,
          38574,
          38568,
          38558,
          38574,
          38582,
          38593,
          38550,
          38589,
          38570,
          38593,
          38537,
          38586,
          38500,
          38545,
          38581,
          38556,
          38572,
          38597,
          38551,
          38552,
          38557,
          38579,
          38520,
          38578,
          38530,
          38560,
          38541,
          38538,
          38568,
          38552,
          38562,
          38551,
          38566,
          38524,
          38550,
          38556,
          38528,
          38552,
          38538,
          38553,
          38532,
          38542,
          38581,
          38545,
          38540,
          38557,
          38537,
          38535,
          38519,
          38549,
          38531,
          38519,
          38559,
          38524,
          38528,
          38547,
          38531,
          38533,
          38541,
          38543,
          38539,
          38541,
          38539,
          38495,
          38508,
          38535,
          38511,
          38529,
          38542,
          38491,
          38535,
          38539,
          38522,
          38510,
          38508,
          38485,
          38510,
          38539,
          38501,
          38496,
          38522,
          38526,
          38523,
          38507,
          38490,
          38536,
          38534,
          38507,
          38545,
          38562,
          38507,
          38536,
          38505,
          38512,
          38521,
          38543,
          38542,
          38512,
          38494,
          38522,
          38509,
          38482,
          38505,
          38524,
          38525,
          38497,
          38483,
          38511,
          38522,
          38502,
          38506,
          38466,
          38494,
          38510,
          38507,
          38572,
          38540,
          38546,
          38533,
          38528,
          38522,
          38473,
          38509,
          38481,
          38524,
          38496,
          38518,
          38494,
          38485,
          38496,
          38500,
          38496,
          38515,
          38515,
          38498,
          38524,
          38509,
          38502,
          38485,
          38527,
          38534,
          38521,
          38496,
          38477,
          38555,
          38545,
          38490,
          38493,
          38487,
          38524,
          38508,
          38475,
          38489,
          38505,
          38514,
          38542,
          38496,
          38505,
          38524,
          38481,
          38507,
          38497,
          38501,
          38511,
          38516,
          38491,
          38502,
          38495,
          38485,
          38521,
          38464,
          38519,
          38490,
          38540,
          38523,
          38539,
          38528,
          38481,
          38518,
          38492,
          38484,
          38521,
          38522,
          38509,
          38498,
          38498,
          38495,
          38546,
          38511,
          38490,
          38528,
          38512,
          38554,
          38511,
          38535,
          38496,
          38501,
          38518,
          38483,
          38537,
          38536,
          38521,
          38527,
          38482,
          38514,
          38528,
          38514,
          38526,
          38533,
          38496,
          38492,
          38438,
          38500,
          38516,
          38513,
          38498,
          38499,
          38493,
          38567,
          38540,
          38504,
          38523,
          38508,
          38515,
          38532,
          38497,
          38513,
          38508,
          38510,
          38547,
          38521,
          38495,
          38533,
          38529,
          38482,
          38555,
          38539,
          38489,
          38506,
          38495,
          38531,
          38501,
          38518,
          38498,
          38545,
          38490,
          38506,
          38462,
          38503,
          38491,
          38488,
          38502,
          38513,
          38530,
          38541,
          38518,
          38527,
          38529,
          38509,
          38510,
          38487,
          38500,
          38504,
          38489,
          38513,
          38500,
          38477,
          38520,
          38482,
          38485,
          38521
        ]
      }
    ]
  ]
}
Img 20171030 190259
Created by

Rodrigo Gomez


Protocol connections:
6
Latest Update:
Apr 2017