post:matlab_to_df.r

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
post:matlab_to_df.r [2019/08/21 14:53] – pseudomoanerpost:matlab_to_df.r [2020/12/17 01:15] (current) – pseudomoaner
Line 1: Line 1:
 ====== matlab_to_df.R ====== ====== matlab_to_df.R ======
  
-Description: +**Class:** Script
  
-Author: Elisa Granato+**Description:** Converts the Matlab-based procTracks structure into an R-based dataframe.
  
-<code rsplus>+Note that variable names may need to be edited in this script to match your version of procTracks. 
 + 
 +If you are using the Matlab-based version of FAST, you will also need to re-save your track data in v6 .mat format for this script to work. Input the following commands to the Matlab command line to do this: 
 + 
 +<code matlab> 
 +clear all 
 +load('C:/Path/To/Target/Mat/Tracks.mat') 
 +save('C:/Path/To/Resaved/Mat/Tracks.mat','procTracks','rawFromMappings','rawToMappings','rawTracks',... 
 +    'trackTimes','toMappings','fromMappings','trackSettings','trackableData','linkStats','-v6') 
 +</code>  
 + 
 +Track .mat files for the stand-alone version of FAST are natively output in -v6 format. 
 + 
 +**Dependencies:** 
 + 
 +  * [[https://cran.r-project.org/web/packages/R.matlab/index.html|R.matlab]] 
 +  * [[https://cran.r-project.org/web/packages/data.table/vignettes/datatable-intro.html|data.table]] 
 + 
 +**Author:** Elisa Granato 
 + 
 +<code rsplus matlab_to_df.R>
  
 # matlab_to_df.R, (c) Elisa Granato, 2019 # matlab_to_df.R, (c) Elisa Granato, 2019
Line 66: Line 86:
 #reshaping the data to have column names with variables #reshaping the data to have column names with variables
  
-# vector containing all variables/measurement labels of interest:+# EDIT VARIABLE NAMES HERE 
 +# Most variable names correspond to the fields of procTracks. Channel names should be written in the order of their indices (e.g. in the below case, channel 1 = brightfield, channel 2 = GFP, channel 3 = Pi)
  
 variables <- c("x","y","smoothx","smoothy","theta","vmag","smoothTheta","smoothVmag","majorLen","minorLen","area","phi","bf.mean","gfp.mean","pi.mean","bf.std","gfp.std","pi.std") variables <- c("x","y","smoothx","smoothy","theta","vmag","smoothTheta","smoothVmag","majorLen","minorLen","area","phi","bf.mean","gfp.mean","pi.mean","bf.std","gfp.std","pi.std")
  • post/matlab_to_df.r.1566395595.txt.gz
  • Last modified: 2019/08/21 14:53
  • by pseudomoaner