cmatkhan commited on
Commit
605a7db
·
verified ·
1 Parent(s): 3cd0c60

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/parse_kemmeren_data.R +26 -15
scripts/parse_kemmeren_data.R CHANGED
@@ -119,9 +119,14 @@ deleteome_all_mutants_controls_long = deleteome_all_mutants_controls %>%
119
  mutate(kemmeren_regulator = toupper(str_remove(tolower(kemmeren_regulator), "-del-1$|-del-mata$|-del$"))) %>%
120
  mutate(kemmeren_regulator = ifelse(kemmeren_regulator == "ARG5,6", "ARG56", kemmeren_regulator))
121
 
122
- kem_sup1_regulator_info = read_excel(here("data/kemmeren/mmc1.xlsx")) %>%
123
- # additional columns are not tabular
124
- .[,1:9]
 
 
 
 
 
125
 
126
  parsed_regulators = deleteome_all_mutants_controls_long %>%
127
  select(kemmeren_regulator) %>%
@@ -179,7 +184,8 @@ regulators_munging_df = bind_rows(regulators_munging_list) %>%
179
  regulator_symbol = symbol)) %>%
180
  replace_na(list(chase_notes = "none")) %>%
181
  mutate(regulator_locus_tag = ifelse(str_detect(kemmeren_regulator, "^WT-"), kemmeren_regulator, regulator_locus_tag),
182
- regulator_symbol = ifelse(str_detect(kemmeren_regulator, "^WT-"), kemmeren_regulator, regulator_symbol))
 
183
 
184
 
185
  stopifnot(setequal(regulators_munging_df$kemmeren_regulator,
@@ -251,11 +257,17 @@ final_parsed_df = Reduce(left_join, final_parsed_list) %>%
251
  # duplicated to mulitple Madj. This removes those duplicates
252
  distinct(reporterId, .keep_all = TRUE) %>%
253
  ungroup() %>%
254
- left_join(select(regulators_munging_df, kemmeren_regulator,
255
- regulator_locus_tag, regulator_symbol)) %>%
256
- select(regulator_locus_tag, regulator_symbol, reporterId,
257
- target_locus_tag, target_symbol, M, Madj, A, pval,
258
- variable_in_wt, multiple_probes)
 
 
 
 
 
 
259
 
260
  db_kemmeren_meta = read_csv("data/kemmeren/db_kemmeren_meta_20251126.csv") %>%
261
  mutate(id = ifelse(regulator_locus_tag == 'YLR352W', 0, id)) %>%
@@ -270,11 +282,11 @@ final_df_parsed_with_ids = final_parsed_df %>%
270
  arrange(regulator_locus_tag) %>%
271
  group_by(regulator_locus_tag) %>%
272
  mutate(sample_id = cur_group_id()) %>%
273
- select(sample_id,db_id,
274
- regulator_locus_tag,regulator_symbol,reporterId,
275
- target_locus_tag,target_symbol,
276
- M,Madj,A,pval,
277
- variable_in_wt,multiple_probes)
278
 
279
  # note! verify before overwriting that the sample_id for the unique sample
280
  # tuple is the same as it is in the current hackett_2020, or that any changes
@@ -290,4 +302,3 @@ final_df_parsed_with_ids = final_parsed_df %>%
290
  # target_locus_tag = TRUE
291
  # )
292
  # )
293
-
 
119
  mutate(kemmeren_regulator = toupper(str_remove(tolower(kemmeren_regulator), "-del-1$|-del-mata$|-del$"))) %>%
120
  mutate(kemmeren_regulator = ifelse(kemmeren_regulator == "ARG5,6", "ARG56", kemmeren_regulator))
121
 
122
+ kem_sup1_regulator_info = read_excel(here("data/kemmeren/supplemental_table1_strain_info.xlsx")) %>%
123
+ mutate(`profile first published` = str_replace(`profile first published`, ", ", ","))
124
+ kem_sup1_regulator_info_straininfo = read_excel(here("data/kemmeren/supplemental_table1_strain_info_origins.xlsx"))
125
+
126
+ kem_sup1_regulator_info = kem_sup1_regulator_info %>%
127
+ left_join(kem_sup1_regulator_info_straininfo) %>%
128
+ mutate(`profile first published` = citation) %>%
129
+ select(-citation)
130
 
131
  parsed_regulators = deleteome_all_mutants_controls_long %>%
132
  select(kemmeren_regulator) %>%
 
184
  regulator_symbol = symbol)) %>%
185
  replace_na(list(chase_notes = "none")) %>%
186
  mutate(regulator_locus_tag = ifelse(str_detect(kemmeren_regulator, "^WT-"), kemmeren_regulator, regulator_locus_tag),
187
+ regulator_symbol = ifelse(str_detect(kemmeren_regulator, "^WT-"), kemmeren_regulator, regulator_symbol)) %>%
188
+ janitor::clean_names()
189
 
190
 
191
  stopifnot(setequal(regulators_munging_df$kemmeren_regulator,
 
257
  # duplicated to mulitple Madj. This removes those duplicates
258
  distinct(reporterId, .keep_all = TRUE) %>%
259
  ungroup() %>%
260
+ left_join(select(regulators_munging_df,
261
+ -c(gene, `orf_name`))) %>%
262
+ dplyr::rename(nr_sign_changes = nr_sign_changes_p_0_05_fc_1_7,
263
+ primary_hybsets = primary_hybset_s,
264
+ source_of_deletion_mutants = source_of_deletion_mutant_s,
265
+ slides = slide_s,
266
+ regulator_desc = description) %>%
267
+ arrange(regulator_locus_tag)
268
+ # select(regulator_locus_tag, regulator_symbol, reporterId,
269
+ # target_locus_tag, target_symbol, M, Madj, A, pval,
270
+ # variable_in_wt, multiple_probes)
271
 
272
  db_kemmeren_meta = read_csv("data/kemmeren/db_kemmeren_meta_20251126.csv") %>%
273
  mutate(id = ifelse(regulator_locus_tag == 'YLR352W', 0, id)) %>%
 
282
  arrange(regulator_locus_tag) %>%
283
  group_by(regulator_locus_tag) %>%
284
  mutate(sample_id = cur_group_id()) %>%
285
+ relocate(sample_id, db_id,
286
+ regulator_locus_tag, regulator_symbol,
287
+ reporterId, target_locus_tag, target_symbol,
288
+ M, Madj, A, pval,
289
+ variable_in_wt, multiple_probes)
290
 
291
  # note! verify before overwriting that the sample_id for the unique sample
292
  # tuple is the same as it is in the current hackett_2020, or that any changes
 
302
  # target_locus_tag = TRUE
303
  # )
304
  # )