Chapter 3 Clean and Process

3.1 Clean

Cleaning data use to be a painful and tedious task for me. It use to involve visualizing data traces in one software (pCLAMP), while jotting down notes in spreadsheets with specific time-stamps and then needing to convert time (in seconds) back to the original sampling frequency so I could go and manually find that data in excel to select/delete by hand (UGH! - I still cringe thinking of doing this…). Sometimes it still amazes me how much faster and easier this is with {lasertrapr}. The benefit of {lasertrapr} is even if you do not like/need the analyzers or other feutures you can easily just use it to clean, process, and export your data.

3.1.1 Cut data

The most common use case for needing to cut data from a trap data trace is when during collection an actin-filament snaps or the myosin sticks down. In these cases, there is still good/usable data present in the trace, but the presence of the large signal disruptions caused by the snapping filament or stick-down could throw off the analyzers. The easiest fix is to cut these portion of the data out. I generally do not recommend deleting data except for these cases in which case I refer to this as “trimming” the data.

Trimming (deleting) an observation to make it analyzer ready is easy with {lasertrapr}. Use the Folder Manager to select an observation, load the observation, select the data to delete, and hit the Cut button. NOTE: This permanently deletes the range of data selected from the trap trace and is irreversible (unless you re-upload your data).

3.1.2 Move data

In some cases, you do not want to delete data, but to split one record into 2 different observations. This is called “moving” data in {lasertrapr}. Sometimes, during collection stage drift occurs so the trace starts with a stable/horizontal time-series, but then over time the data starts to trend with time upwards in the y-dimensions turning the signal into a diagonal line. One way to deal with this is to split the single obs into two seperate ones so the two-halves can be processed separately with the diagonal potion getting detrended later.

Moving data is the same procedure as cutting data, except for the final button pushed! Load an obs, select the data to move, and click move. A new observation folder will be made with the selected data and the selected data will be deleted out of the current obs. NOTE: This cannot be undone without manual intervention (you would have to load the trap-data.csv files into R and rbind them back together or re-upload the data and start again).

3.2 Process

Another benefit that I have enjoyed while analyzing my own data with {lasertrapr} is the ability to easily visualize how processing will transform my data before deciding to save/analyze it. Currently, you can convert data from mV-to-nm with a pre-determined user conversion value, center the baseline mean to zero using either the “baseline range” or “remove mv” techniques, or you can detrend your data with a peice-wise linear detrend-er.

3.2.1 Convert to nm

Short and sweet. Enter your pre-determined mV-to-nm conversion in the Step Cal box and hit Graph to preview.

3.2.2 Remove baseline

When collecting laser trap data the detector is measuring the relative intensity of light across its four-quadrants. The data is saved in units of millivolts (mV) and is usually not centered around 0mV. So, when the data is converted to nanometers the y-axis range becomes some arbitrarily large or nonsense negative value. Technically there is nothing wrong with this since we are interested in making relative measurements of displacements from baseline, but it makes more sense and is easier to read when the y-axis is centered around 0nm. This can be accomplished by calculating the average position of the baseline signal and subtracting that value from every point in the y-dimension. Baseline removal is currently implmented in 3 ways: baseline range, remove MV, and detrending the data. Range

The baseline range is simplest and the most “legacy” (i.e. this was easiest for me to implement when I was doing this all manually before {lasertrapr}). You can manually select a quiescient perioed of data that represents the baseline signal and they mean position of this period of data will be calculated. By selecting remove base from the Graph Options and hitting Graph to update the app will provide a preview. NOTE: this will not be saved until you explicitly hit save. Remove MV

Sometimes it can be tricky to find a nice quiescent period of baseline signal to calcualte the range. This is expecially the case with fast motors and mini-ensemble experiments. Instead it can be helpful to use the Remove MV option. This will perform a Mean-Variance transformation of the entire data trace and show the plot in an interactive window. You can then select the area that represents the baseline population, the mean is calculated, and by selecting Remove MV in Graph Options and hitting Graph to update, the app will provide a preview. NOTE: this will not be saved until you explicitly hit save.

3.2.3 Detrend data

Stage drift can occur in longer records, or put another way the displacement on the y-axis will start to trend with time on the x-axis. There should be no relationship between time and displacement (slope should be 0). If this occurs the data record will look like it is tilted diagonally. This can be compensated by de-trending the data. A piecewise linear regression is fit to every 5 seconds of data and the resulting slope is removed from the data. Select Detrend in Graph Options and click Graph to preview the results. This also centers the baseline around 0. NOTE: this will not be saved until you explicitly hit save.

3.2.4 To Include, or not to Include…

I do not like deleting data, but I also do not like wasting my time. Unfortunately, not all that glitters is gold, or not all trap data that is collected is usable. If I know that data does not look like exceptional signal-to-noise, there are no events, or will probably not analyze well I want to exclude those events from analysis so they do not take time getting analyzed etc.

By default, {lasertrapr} excludes all data from analysis so you need to Include the data for the app to analyze it.

If you like the data check the Include button when saving data.

3.2.5 Save!

NOTE: The app will not save anything unless you save the changes!