cmatkhan commited on
Commit
b11a8f7
·
verified ·
1 Parent(s): 6f111ec

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/parse_hughes_2006.R +45 -42
scripts/parse_hughes_2006.R CHANGED
@@ -225,6 +225,7 @@ genome_map = tibble(
225
  stopifnot(setequal(genome_map$hughes_target, unique(df_oe$hughes_target)))
226
 
227
  hughes_2006_meta_with_id = hughes_2006_meta %>%
 
228
  group_by(regulator_locus_tag) %>%
229
  mutate(sample_id = cur_group_id()) %>%
230
  ungroup() %>%
@@ -245,20 +246,21 @@ df_oe_harmonized = df_oe %>%
245
  select(sample_id,
246
  regulator_locus_tag, regulator_symbol,
247
  target_locus_tag, target_symbol,
248
- dye_plus, dye_minus, mean_norm_log2fc)
249
-
250
- # df_oe_harmonized %>%
251
- # write_parquet("~/code/hf/hughes_2006/overexpression.parquet",
252
- # compression = "zstd",
253
- # write_statistics = TRUE,
254
- # use_dictionary = c(
255
- # sample_id = TRUE,
256
- # regulator_locus_tag = TRUE,
257
- # regulator_symbol = TRUE,
258
- # target_locus_tag = TRUE,
259
- # target_symbol = TRUE
260
- # )
261
- # )
 
262
 
263
  df_ko_harmonized = df_ko %>%
264
  left_join(
@@ -270,31 +272,32 @@ df_ko_harmonized = df_ko %>%
270
  select(sample_id,
271
  regulator_locus_tag, regulator_symbol,
272
  target_locus_tag, target_symbol,
273
- dye_plus, dye_minus, mean_norm_log2fc)
274
-
275
- # df_ko_harmonized %>%
276
- # write_parquet("~/code/hf/hughes_2006/knockout.parquet",
277
- # compression = "zstd",
278
- # write_statistics = TRUE,
279
- # use_dictionary = c(
280
- # sample_id = TRUE,
281
- # regulator_locus_tag = TRUE,
282
- # regulator_symbol = TRUE,
283
- # target_locus_tag = TRUE,
284
- # target_symbol = TRUE
285
- # )
286
- # )
287
-
288
- # hughes_2006_meta_with_id %>%
289
- # janitor::clean_names() %>%
290
- # write_parquet("~/code/hf/hughes_2006/metadata.parquet",
291
- # compression = "zstd",
292
- # write_statistics = TRUE,
293
- # use_dictionary = c(
294
- # sample_id = TRUE,
295
- # regulator_locus_tag = TRUE,
296
- # regulator_symbol = TRUE,
297
- # oe_passed_qc = TRUE,
298
- # del_passed_qc = TRUE
299
- # )
300
- # )
 
 
225
  stopifnot(setequal(genome_map$hughes_target, unique(df_oe$hughes_target)))
226
 
227
  hughes_2006_meta_with_id = hughes_2006_meta %>%
228
+ arrange(regulator_locus_tag) %>%
229
  group_by(regulator_locus_tag) %>%
230
  mutate(sample_id = cur_group_id()) %>%
231
  ungroup() %>%
 
246
  select(sample_id,
247
  regulator_locus_tag, regulator_symbol,
248
  target_locus_tag, target_symbol,
249
+ dye_plus, dye_minus, mean_norm_log2fc) %>%
250
+ arrange(sample_id, target_locus_tag)
251
+
252
+ df_oe_harmonized %>%
253
+ write_parquet("~/code/hf/hughes_2006/overexpression.parquet",
254
+ compression = "zstd",
255
+ write_statistics = TRUE,
256
+ use_dictionary = c(
257
+ sample_id = TRUE,
258
+ regulator_locus_tag = TRUE,
259
+ regulator_symbol = TRUE,
260
+ target_locus_tag = TRUE,
261
+ target_symbol = TRUE
262
+ )
263
+ )
264
 
265
  df_ko_harmonized = df_ko %>%
266
  left_join(
 
272
  select(sample_id,
273
  regulator_locus_tag, regulator_symbol,
274
  target_locus_tag, target_symbol,
275
+ dye_plus, dye_minus, mean_norm_log2fc) %>%
276
+ arrange(sample_id, target_locus_tag)
277
+
278
+ df_ko_harmonized %>%
279
+ write_parquet("~/code/hf/hughes_2006/knockout.parquet",
280
+ compression = "zstd",
281
+ write_statistics = TRUE,
282
+ use_dictionary = c(
283
+ sample_id = TRUE,
284
+ regulator_locus_tag = TRUE,
285
+ regulator_symbol = TRUE,
286
+ target_locus_tag = TRUE,
287
+ target_symbol = TRUE
288
+ )
289
+ )
290
+
291
+ hughes_2006_meta_with_id %>%
292
+ janitor::clean_names() %>%
293
+ write_parquet("~/code/hf/hughes_2006/metadata.parquet",
294
+ compression = "zstd",
295
+ write_statistics = TRUE,
296
+ use_dictionary = c(
297
+ sample_id = TRUE,
298
+ regulator_locus_tag = TRUE,
299
+ regulator_symbol = TRUE,
300
+ oe_passed_qc = TRUE,
301
+ del_passed_qc = TRUE
302
+ )
303
+ )