Skip to content

Inconsistent division tracking #6

@holgerbrandl

Description

@holgerbrandl

We should perform a consistency check - every cell appearing by division should be a daughter of some cell and daughters of each dividing cell should be cells in the database! Should we flag these cells also as segmentation errors?

movieDir="/Users/brandl/Desktop/WT_25deg_111102_ForTissueMiner"
db_name=basename(movieDir)

Sys.setenv(TM_HOME="/Volumes/projects/project-raphael/scripts/tissue_miner")
scriptsDir=Sys.getenv("TM_HOME")

source(file.path(scriptsDir, "commons/TMCommons.R"))
## [1] "using config file /Volumes/projects/project-raphael/scripts/tissue_miner/config/default_config.R"
movieDb <- openMovieDb(movieDir)

cellinfo <- dbGetQuery(movieDb, "select * from cell_histories")

Every cell appearing by division should be a daughter of some cell

daughterInfo <- cdByDaughters(movieDb)


ciWithMother <- left_join(cellinfo, daughterInfo %>% select(-first_occ))

ciWithMother %>% count(appears_by, !is.na(mother_cell_id))
## Source: local data frame [6 x 3]
## Groups: appears_by [?]
## 
##         appears_by !is.na(mother_cell_id)     n
##              (chr)                  (lgl) (int)
## 1         Division                  FALSE   212
## 2         Division                   TRUE 34702
## 3    MovedIntoMask                  FALSE 12339
## 4    MovedIntoMask                   TRUE    14
## 5 SegErrAppearance                  FALSE  2669
## 6     Unclassified                  FALSE  9380
divWithoutMother <- filter(ciWithMother, is.na(mother_cell_id) & appears_by=="Division")

divWithoutMother %>% count(first_occ)
## Source: local data frame [125 x 2]
## 
##    first_occ     n
##        (int) (int)
## 1          2     1
## 2          3     1
## 3          4     3
## 4          5     1
## 5          8     1
## 6          9     2
## 7         10     1
## 8         12     3
## 9         13     1
## 10        14     1
## ..       ...   ...
divWithoutMother %>% nrow
## [1] 212
divWithoutMother %>% count(generation)
## Source: local data frame [1 x 2]
## 
##   generation     n
##        (int) (int)
## 1          0   212

This means that the problematic cases are tied to the first generation which seem to be incorrectly tagged as being the result of a division.
Those flags seem to be directly extracted from cell_in_frame.dat, so it could be parser problem?

Daughters of each dividing cell should be cells in the database

allDaughters <- cellinfo %$%
    c(right_daughter_cell_id, left_daughter_cell_id) %>%
    na.omit() %>% data_frame(cell_id=.)
allDaughters %>% anti_join(cellinfo)  %>% nrow
## [1] 0

Seems fine at least for WT_25deg_111102_ForTissueMiner

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions