Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BUG: Remove duplicate control rows
  • Loading branch information
pan14001 committed Feb 7, 2017
1 parent 3d47c39 commit 6032c6b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions analysis-only_overlap.R
@@ -1,5 +1,6 @@
suppressPackageStartupMessages({
library(tidyverse)
library(magrittr)
library(readxl)
library(stringr)
library(methods) # For Rscript per http://stackoverflow.com/a/41797025
Expand Down Expand Up @@ -27,26 +28,21 @@ wells_control_plate504 <- tibble::tribble(
well = c("C03", "C22", "D12", "D13", "E05", "E20", "F11",
"F14", "G07", "G18", "H09", "H16", "I09", "I16",
"J07", "J18", "K11", "K14", "L05", "L20", "M12",
"M13", "N03", "N22")))
"M13", "N03", "N22"))) %>%
rename(symbol_504 = symbol) %>% # Prepare for join.
mutate(plate = 504) %>%
arrange(well)
## FIXME: Need to confirm what type of control Thread is.
wells_layout <-
read_excel(files_plate, sheet = 3) %>%
setNames(tolower(names(.))) %>%
select(plate, well, `symbol(s)`, `fbgn(s)`, amplicon) %>%
rename(symbol = `symbol(s)`,
fbgn = `fbgn(s)`)

wells_control_comparison <- merge(
wells_layout %>% filter(well %in% wells_control_plate504$well,
plate %in% c(501:504, 507)) %>%
select(-fbgn, -amplicon) %>% spread(plate, symbol),
wells_control_plate504 %>% rename(`504_new` = symbol)) %>%
.[, order(colnames(.))] %>% select(well, everything())
write_csv(wells_control_comparison, "plate504-different-controls.csv")

fbgn = `fbgn(s)`) %>% arrange(plate, well)
wells_layout %<>%
bind_rows(mutate(wells_control_plate504, plate = 504)) %>%
arrange(plate, well) %>%
left_join(wells_control_plate504) %>%
mutate(symbol = ifelse(is.na(symbol_504), symbol, symbol_504)) %>%
select(-symbol_504) %>%
mutate(control = ifelse(
symbol %in% c("CAL1", "FACT", "Rho1"), ## Rho1 gives binucleates
"positive", NA)) %>%
Expand Down

0 comments on commit 6032c6b

Please sign in to comment.