cmatkhan commited on
Commit
15f15de
·
1 Parent(s): 849a2cf

fixing chromosome names in id 762 to ucsc

Browse files
genome_map/batch=run_7269/part-0.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8b00e75f122d84ee025ac416bedd1dc3f5ea75cb742ab07fdd326a29bb750ecf
3
- size 983822
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b14d11fb9f1677067fd60868851b2bea8562f6c8e47ec839c4fd89af8888436a
3
+ size 974357
scripts/quantify_regions.R CHANGED
@@ -433,12 +433,66 @@ enrichment_analysis <- function(experiment_gr,
433
 
434
  # Example Usage -----------------------------------------------------------
435
 
436
- # This is a template for how to use these functions
437
- # Uncomment and modify for your actual data
 
438
 
439
  genome_map_replicate_ds = arrow::open_dataset("~/code/hf/callingcards/genome_map")
440
  genome_map_replicate_meta = arrow::read_parquet("~/code/hf/callingcards/genome_map_meta.parquet")
441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  background_gr <- read_tsv("~/code/hf/callingcards/adh1_background_ucsc.qbed") %>%
443
  mutate(id = "adh1_bg",
444
  score = scales::rescale(depth, to = c(1,1000))) %>%
@@ -449,7 +503,6 @@ regions_gr <- read_tsv("~/code/hf/yeast_genome_resources/yiming_promoters.bed",
449
  col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
450
  bed_to_granges()
451
 
452
- genomic_features = arrow::read_parquet("~/code/hf/yeast_genome_resources/brentlab_features.parquet")
453
 
454
  # # Run analysis with deduplication (default for calling cards)
455
  results_replicates = map(genome_map_meta$id, ~{
 
433
 
434
  # Example Usage -----------------------------------------------------------
435
 
436
+ # add another batch to the genome map
437
+
438
+ genomic_features = arrow::read_parquet("~/code/hf/yeast_genome_resources/brentlab_features.parquet")
439
 
440
  genome_map_replicate_ds = arrow::open_dataset("~/code/hf/callingcards/genome_map")
441
  genome_map_replicate_meta = arrow::read_parquet("~/code/hf/callingcards/genome_map_meta.parquet")
442
 
443
+ max_gm_id = max(genome_map_replicate_meta$id)
444
+
445
+ rs_rl_map = dplyr::select(genomic_features,
446
+ regulator_locus_tag = locus_tag,
447
+ regulator_symbol = symbol) %>%
448
+ filter(regulator_symbol %in% c("MED2", "XBP1", "UME1", "RPH1"))
449
+
450
+
451
+ run_7488_qbed = list.files("~/htcf_local/cc/yeast/results/run_7488/hops",
452
+ "*qbed",
453
+ full.names=TRUE)
454
+ run_7489_qbed = list.files("~/htcf_local/cc/yeast/results/run_7489/hops",
455
+ "*qbed",
456
+ full.names=TRUE)
457
+
458
+ new_metadata = read_tsv("~/htcf_local/cc/yeast/data/run_7488/JP094_barcodes.txt",
459
+ col_names = c("regulator", "bc1", "bc2")) %>%
460
+ mutate(condition = ifelse(str_detect(regulator, "∆"), "del_MSN2", "standard")) %>%
461
+ mutate(regulator_symbol = str_remove(regulator, "∆.*")) %>%
462
+ mutate(batch = "run_7488") %>%
463
+ bind_rows(
464
+ read_tsv("~/htcf_local/cc/yeast/data/run_7489/JP095_barcodes.txt",
465
+ col_names = c("regulator", "bc1", "bc2")) %>%
466
+ mutate(condition = ifelse(str_detect(regulator, "∆"), "del_MSN2", "standard")) %>%
467
+ mutate(regulator_symbol = str_remove(regulator, "∆.*")) %>%
468
+ mutate(batch = "run_7489")) %>%
469
+ mutate(binding_id = "NA") %>%
470
+ left_join(rs_rl_map) %>%
471
+ mutate(replicate = 1,
472
+ notes = "none") %>%
473
+ mutate(id = max_gm_id + row_number()) %>%
474
+ dplyr::select(id, binding_id, regulator_locus_tag, regulator_symbol,
475
+ batch, replicate, notes, condition) %>%
476
+ left_join(
477
+ tibble(qbed = c(run_7488_qbed, run_7489_qbed)) %>%
478
+ mutate(batch = str_extract(basename(qbed), "run_\\d+")) %>%
479
+ mutate(condition = ifelse(str_detect(basename(qbed), "del"), "del_MSN2", "standard")) %>%
480
+ mutate(regulator_symbol = str_remove_all(basename(qbed), "run_\\d+_|del.*|.qbed")) %>%
481
+ filter(regulator_symbol != "undetermined")
482
+ )
483
+
484
+ new_data = map(c(run_7488_qbed, run_7489_qbed), ~{
485
+ in_path = file.path("~/htcf_local/cc/yeast/results/")
486
+ read_tsv(.)
487
+ })
488
+
489
+
490
+
491
+
492
+ # This is a template for how to use these functions
493
+ # Uncomment and modify for your actual data
494
+
495
+
496
  background_gr <- read_tsv("~/code/hf/callingcards/adh1_background_ucsc.qbed") %>%
497
  mutate(id = "adh1_bg",
498
  score = scales::rescale(depth, to = c(1,1000))) %>%
 
503
  col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
504
  bed_to_granges()
505
 
 
506
 
507
  # # Run analysis with deduplication (default for calling cards)
508
  results_replicates = map(genome_map_meta$id, ~{