diff --git a/analysis-only_overlap.R b/analysis-only_overlap.R index 4ba1d12..aba906b 100644 --- a/analysis-only_overlap.R +++ b/analysis-only_overlap.R @@ -41,12 +41,15 @@ images <- dbReadTable(con, "Per_Image") %>% setNames(tolower(names(.))) ## Create well summary from images and cells. `imagenumber` is a ## primary key. -wells <- merge(cells, select(images, imagenumber, image_metadata_well)) %>% +wells <- merge(cells, select(images, imagenumber, image_metadata_well, + image_metadata_plate)) %>% replace_na(list(ect_classify_coloc = 0)) %>% - group_by(image_metadata_well) %>% + group_by(image_metadata_well, image_metadata_plate) %>% summarise(n = n(), n_coloc = sum(ect_classify_coloc)) # Check the controls. -controls <- filter(wells, image_metadata_well %in% wells_control) %>% +controls <- filter(wells, + image_metadata_well %in% wells_control, + image_metadata_plate == "160415_015529-V") %>% mutate(coloc = n_coloc / n) print(controls)