Data Fetching
Determine Download Parameter AFM txt-files
# path to AFM files on the server or a local machine, all files in that folder will be read
setwd("/Users/joergheintz/Documents/06_Projects/FrictionCellMembranes")
mypath <- "/Users/joergheintz/Documents/06_Projects/FrictionCellMembranes/02_Data"
# provide number of lines that need to be skipped, header of AFM file
fileLineOffset <- 12
# spring constant alpha
alpha = 2.93
# provide column numbers
ColumnsOfInterest <- c(1,7,8) # provide columnames tha need to be read in. predefined is x, y-trace, y-retrace
lowlimit = 513 #read lines from "lowlimit" to "uplimit" from each AFT txt file
uplimit = 4096 #read lines from "lowlimit" to "uplimit" from each AFT txt file
# collect and stores data from the raw AFM files
myRawData<-Ingestion(alpha = alpha, ColumnsOfInterest = ColumnsOfInterest, fileLineOffset = fileLineOffset,
mypath = mypath, lowlimit = lowlimit , uplimit = uplimit)
Ingestion and Processing
Data Manipulation for Plotting
# Determining trace or retrace, this file reads the csv file that is generated in the "Ingestion" function
myfilename<-"CellMembrane_Friction_20170324.csv"
y_trace__y_retrace<-"y_trace" # options are y_trace / Y_retrace
# Reads from the RawData File a data subset
#. e.g. trace or retrace, and categorical variables from the AFM
mydata<-PreprocessingIngestedRawData(myfilename = myfilename, y_trace__y_retrace = y_trace__y_retrace)
## Data Manipulation / Selection for Plots
# Case Definitions
GelPEMvsFullsytem_2nN_50nN <- as.logical(mydata$system == "GelPEM" | mydata$system == "FullSystem")
GelPEMvsFullsytem_2nN <- as.logical((mydata$system == "GelPEM" | mydata$system == "FullSystem") & mydata$f_on_samp == "2nN")
GelPEMvsGelvsFullsytem_2nN <- as.logical((mydata$system == "GelPEM" | mydata$system == "FullSystem" | mydata$system == "Gel") &
mydata$f_on_samp == "2nN")
GelPEMvsFullsytem_50nN <- as.logical((mydata$system == "GelPEM" | mydata$system == "FullSystem") & mydata$f_on_samp == "50nN")
GelvsFullsytem_50nN <- as.logical((mydata$system == "Gel" | mydata$system == "FullSystem") & mydata$f_on_samp == "50nN")
GelvsFullsytem_2nN <- as.logical((mydata$system == "Gel" | mydata$system == "FullSystem") & mydata$f_on_samp == "2nN")
# mydata<-mydata[GelPEMvsFullsytem_2nN_50nN, ]
#mydata<-mydata[GelPEMvsFullsytem_2nN, ]
mydata<-mydata[GelPEMvsGelvsFullsytem_2nN, ]
#mydata<-mydata[GelPEMvsFullsytem_50nN, ]
#mydata<-mydata[GelvsFullsytem_2nN, ]
#mydata<-mydata[GelvsFullsytem_50nN, ]
Data Processing Pipeline
# Pipeline
## Data PreProcessing, mark sticks and slips
mydata<-StickSlip(mydata, "half_loop")
## Cluster the sticks and slips, provide data.frame and name for the cluster variable
mydata<-BuildCluster(mydata, "st_sl")
## Determine max min slope by dymax/dxmax for each peak
mydata<-MinMaxSlope(mydata)
## Calculate the segmebts (with x, xend=x+dx, y, yend=y+dy
mydata<-Segments(mydata)
## Smoothing (mean of +- 2 points)
mydata<-Smoothing(mydata)
## write and arrange columns from left to right
mydata <- mydata %>% select( ID,half_loop, cluster, mSL, y, ySmooth, dy, dymax, x, dx, dxmax, alpha, slope,
st_sl, xmin:ymax, f_on_samp, system, trace_d, line_rate, length, tip, date)
write.csv(mydata, file = paste(Sys.Date(), "_StickSlip_Cluster_Slope_Segments_", myfilename), row.names = FALSE )
## Plotting
PlotCol(mydata, c = 3, p = 0)

Peaks & Segments Plots
PlotCol_RegLine(mydata, c=3, p=0, w = 8)

Residuals-Plot
PlotColLm(mydata, c = 3, p = 0)

Slope Plotting
PlotSlope(mydata, p = 0, c =3, w = 10, h = 18 )

Variable Description
- x in [um], AFM output
- u.def in [V$ 110^-6 V$ ], AFM output
- st_sl, [1,-1], 1 = stick = positive slope, slip = -1 negative slope
- cluster in [integer], one cluster represents one peak, each cluster contains n points that belong to that peak
- sl_fac [points/peak], measure points pro peak
- alpha [nN/V], calibration constant for calculating the friction force f_friction
- f_friction in [nN]
- f_on_samp in [nN], normal force applied on sample
- 2nN
- 10nN
- 20nN
- x_speed in [um/s], AFM “slider” speed, the speed is calcuated by: lenght[um] x line rate [Hz=1/s] x 2 (half loops)
- 1um/s
- x mm/s
- line rate [1/sec], frequency of the line scanning, AFM scannes several lines (back and forth) over the same length to collect data, and to determine the trace, retrace values.
- length [um], the trace or retrace distance
- trace_d [1,0], scans in the forward (trace=1, 1-512 Bit) and reverse (retrace=-1, 513-1024 Bit) directions
- half_loop[#], number half loops per experiement, one half loop is one complete trace or retrace
- x_scan_dist in [um], max scan length of 10um (512 bits) both directions.
- substrates [categorical]
- bg = 1st control bare gel
- gel_PEM = 2nd control is gel-PEM with polymers on surface
- LB_on_Si = 3rd control, lipid bilayer on silica
- LB_on_gelPEM = fullsystem cell membrane model, lipid bilayer on gel-PEM.
- Tip
- blunt