cells2numbers / migrationminer

MigrationmineR is a R package to analyse and profile in vitro cell tracking and migration data. It is belongs to the cytominer-verse used for morphological profiling and allows to create temporal or dynamic profiles.
Other
5 stars 0 forks source link

Add windowed profiles #22

Open cells2numbers opened 5 years ago

cells2numbers commented 5 years ago

Add functionality to calculate the migration parameter on a windowed frame. This allows quantifying the change of migration over time.

Sample code:

create_windowed_migration_profiles <- function(df_temp, t1, offset = 20) {
  df_temp %<>% 
    filter(Metadata_frame > t1) %>% 
    filter(Metadata_frame < (t1 + offset) ) 

  tracks <- migrationminer::track(
      df_temp, 
      c("TrackObjects_Label"),
      t_var = "Metadata_frame"
    )  %>% 
    filter(complete.cases(.)) %>% 
    filter(Track_Length > offset/2) %>% 
    summarise_all( mean) %>% 
    mutate(Metadata_Frame_Subset = t1) %>% 
    mutate(Metadata_offset = offset) 

  return(tracks)
} 

Temporal change of the migration parameter 'speed' over time. Different window sizes (offsets) were chosen. The shown data belongs to an experiment that is characterized by a strong flow image