###################################################################################################################
## README for code used in
## "Rapid propagation of membrane tension at retinal bipolar neuron presynaptic terminals"
## by Authors: 
## Carolina Gomis Perez, Natasha R. Dudzinski,  Mason Rouches, Ane Landajuela, Benjamin Machta, David Zenisek, and ## Erdem Karatekin
## Science Advances, 2021
##
## If you use any of this code, please cite our paper. 
## 
## README last updated 10-27-21
###################################################################################################################


###############################
##### IMAGE ANALYSIS  #########
##### - Tether Dragging #######
###############################

# Introduction : Tether-dragging experiments were performed to probe the membrane-cytoskelton friction and adhesion. Data was collected as videos/images neccessiating image analysis code to process and quantify data in a consistent manner. Included here is code to analyze individual tether-sliding experiments, and code to collate and analyze many processed experiments. Code inputs, outputs, and directions can be found in "ImageAnalysis/ImageAnalysisReadme.txt". This code was used to generate Figure 3, Figure S8

### Prerequisite software:
# Bio-Formats Matlab libraries https://docs.openmicroscopy.org/bio-formats/5.3.4/users/matlab/index.html  (must be in matlab path)
# Matlab Image Processing, Signal Processing, and Computer Vision Toolboxes 

########################################
# Data Analysis and Visualization Scripts

### TetherSlidingAnalysis.m:
    Description : Runs the complete tether-sliding analysis pipeline. Calculatees the tether forces, tether velocity, sliding angle from .tiff image date
    Calls: trackCirclePos.m, PreprocessImages.m,OTForceVector.m,trackmembraneEdgeRegistered.m
### PlotCombinedTetherData.m
    Description: Collates files corresponding to individual experiments generated by TetherSlidingAnalysis.m, and plots data by cell type, condition, etc. 

######################################
# Auxilliary "Helper" Functions

### PreprocessImages.m :
    Description: Loads and processes a .tiff file image
### trackCirclePos.m:
    Descritption : Tracks the position of a bead held in an optical trap
    Calls: PreprocessImages.m
### OTForceVector.m:
    Description: Calculates the force on the bead
    Calls: trackCirclePos.m, PreprocessImages.m
### trackMembraneEdgeRegistered.m:
    Descrption:Tracks the edge of a membrane using points generated by JFilament.
    Calls trackCirclePos.m, PreprocessImages.m


###############################
##### IMAGE ANALYSIS  #########
##### - Additional Code #######
###############################
Introduction: Code used for assorted image analysis tasks: quantifying membrane fluoresence and tracking OT beads in most cases

####################
# Functions

## EK_TrackCircle.m
Description: Tracks a bead in an OT experiment. Used in tracking all OT experiments other than tether dragging

#####################   
# Scripts
## ReadSnakes.m
   Description: Reads membrane contour "snake" generated by JFilament
## SnakeIntensity.m
   Descirption: Convert snake data as stored in readSnakes.m to intensity data 


#######################
### MODELING ##########
#######################
Introduction: Data collected in Double-tether pulling experiments suggested that tension propagates rapidly and with high amplitude in bipolar terminals. To test the predictions of a purely diffusive mechanism of tension Propagation, we simulated the model developed in "Shi, Z. et al, Cell. 2018" in a way that was consistent with our experimental protocol. The code here simualates tension propagation allowing wide choices of parameters. Additonally included is code that processes data from double tether experiments, and generates fits from simulated protocols at various diffusion constants.  Code inputs, outputs, and directions can be found in "Modeling/ModelingReadme.txt". This code was used in generating Figure 2, Figure S7 in the manuscript

#########################################
# Data Analysis and Visualization Scripts

### ProcessDoubleTetherData.m:
    Description : Script for processing experimental DT data and fitting to simulated traces, generating plots
    Calls: FitExperimentalTension.m,TensionDiffusionSimulation.m, EK_tensoinDiffusion.m

####################
# Functions 

### EK_tensionDiffusion.m:
    Description: Integrates Diffusion equation starting
### FitExperimentalTension.m:
    Description
    Calls: TensionDiffusionSimulation.m	, EK_tensoinDiffusion.m
### TensionDiffusionSimulation.m
    Description: Simulates membrane tension propagation as a tether is pulled from  
    Calls : EK_tension_diffusion.m

    
########################
### FRAP ##############
########################
Single script fitting FRAP fluoresence data to recovery equation 'Fluor(t) = (I0 + Iinf.*(t/t_half))./ (1 + (t/t_half))' where t_half is the half time of fluouresence recovery and Iinf is the long-time fluoresence and I_0 is initial fluoresence (near 0), t is time.
