cmatkhan commited on
Commit
e73df12
·
1 Parent(s): eed6010

adding mindel analysis set

Browse files
README.md CHANGED
@@ -110,6 +110,7 @@ features:
110
  - annotated_feature_combined_meta
111
  - genome_map_meta
112
  - 2026_analysis_set
 
113
  fields:
114
  - name: regulator_locus_tag
115
  dtype: string
@@ -126,6 +127,7 @@ features:
126
  - 2026_analysis_set
127
  - annotated_feature_reprocess_yiming
128
  - annotated_feature_reprocess_mindel
 
129
  fields:
130
  - name: target_locus_tag
131
  dtype: string
@@ -142,6 +144,7 @@ features:
142
  - 2026_analysis_set
143
  - annotated_feature_reprocess_yiming
144
  - annotated_feature_reprocess_mindel
 
145
  fields:
146
  - name: experiment_hops
147
  dtype: float64
@@ -177,6 +180,7 @@ features:
177
  - applies_to:
178
  - annotated_feature_reprocess_yiming
179
  - annotated_feature_reprocess_mindel
 
180
  fields:
181
  - name: total_background_hops
182
  dtype: float64
@@ -479,6 +483,31 @@ configs:
479
  dtype: int64
480
  description: >-
481
  Genome map identifier linking to the genome_map and genome_map_meta dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
482
  ---
483
  # Calling Cards
484
 
 
110
  - annotated_feature_combined_meta
111
  - genome_map_meta
112
  - 2026_analysis_set
113
+ - annotated_feature_reprocess_mindel_analysis
114
  fields:
115
  - name: regulator_locus_tag
116
  dtype: string
 
127
  - 2026_analysis_set
128
  - annotated_feature_reprocess_yiming
129
  - annotated_feature_reprocess_mindel
130
+ - annotated_feature_reprocess_mindel_analysis
131
  fields:
132
  - name: target_locus_tag
133
  dtype: string
 
144
  - 2026_analysis_set
145
  - annotated_feature_reprocess_yiming
146
  - annotated_feature_reprocess_mindel
147
+ - annotated_feature_reprocess_mindel_analysis
148
  fields:
149
  - name: experiment_hops
150
  dtype: float64
 
180
  - applies_to:
181
  - annotated_feature_reprocess_yiming
182
  - annotated_feature_reprocess_mindel
183
+ - annotated_feature_reprocess_mindel_analysis
184
  fields:
185
  - name: total_background_hops
186
  dtype: float64
 
483
  dtype: int64
484
  description: >-
485
  Genome map identifier linking to the genome_map and genome_map_meta dataset
486
+
487
+ - config_name: annotated_feature_reprocess_mindel_analysis
488
+ description: >-
489
+ This is the analysis set for the mindel data. It is generated using the same logic as the 2026_analysis_set, but using the results from the reprocessing against the mindel promoters. A passing replicate has >=3000 hops had a dto empirical pvalue < 0.01 against either kemmeren or hackett. Where a given regulator had multiple passing replicates, those replicates were combined (see annotated_feature_combined). This dataset should be used when you want to use data that can be reproduced directly from the genome_map data included in this repo, using the mindel promoter definitions. See scripts/quantify_regions.R as well as BrentLab/yeast_comparative_analysis/scripts for details of how this was conducted.
490
+ dataset_type: annotated_features
491
+ metadata_fields: ["combined_id","regulator_locus_tag","regulator_symbol", "experiment_total_hops", "background_total_hops"]
492
+ data_files:
493
+ - split: train
494
+ path: annotated_feature_reprocess_mindel_analysis.parquet
495
+ genome_resources:
496
+ region_sets:
497
+ Mindel:
498
+ path: https://huggingface.co/datasets/BrentLab/yeast_genome_resources/blob/main/mindel_promoters.csv.gz
499
+ join_column: target_locus_tag
500
+ dataset_info:
501
+ features:
502
+ - name: combined_id
503
+ dtype: string
504
+ description: >-
505
+ The genome map identifier of either a single passing, or multiple
506
+ passing replicates (hyphen-delimited) that were combined for the analysis set. replicates were combined if the DTO empirical
507
+ pvalue was <= 0.01 in either kemmeren or hackett. After combining,
508
+ if they have more than 3k hopes (single or combined), then they are
509
+ included in the analysis set.
510
+ role: sample_id
511
  ---
512
  # Calling Cards
513
 
annotated_feature_reprocess_mindel_analysis.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8198424bd09ae489bb569b77e1e34360b5accca195aae78cd9931842b70890e
3
+ size 11159225
scripts/quantify_regions.R CHANGED
@@ -673,3 +673,84 @@ results_replicates_df = bind_rows(map(results_replicates, as_tibble), .id = "gen
673
  # genome_map_id = TRUE
674
  # )
675
  # )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  # genome_map_id = TRUE
674
  # )
675
  # )
676
+
677
+ # creating the combined data for a new set
678
+
679
+ hackett_dedup = arrow::read_parquet("~/code/hf/hackett_2020/hackett_2020_analysis_set.parquet")
680
+
681
+ dto_results = arrow::open_dataset("~/code/hf/yeast_comparative_analysis/dto_rossi_cc_mahendrawada_mindel/")
682
+
683
+ # empirical pval < 0.01 in at least one of {kemmeren, hackett-at-30min}
684
+ passing_cc_reps = dto_results |>
685
+ filter(perturbation_repo_dataset == "hackett_2020-hackett_2020"
686
+ | perturbation_repo_dataset == "kemmeren_2014-kemmeren_2014",
687
+ binding_repo_dataset == "callingcards-annotated_feature_reprocess_mindel",
688
+ pr_ranking_column == "pvalue") |>
689
+ collect() |>
690
+ filter(perturbation_repo_dataset == "kemmeren_2014-kemmeren_2014" | perturbation_id %in%
691
+ paste0("BrentLab/hackett_2020;hackett_2020;", unique(pull(filter(hackett_dedup, time == 30), sample_id)))) |>
692
+ group_by(binding_id) |>
693
+ filter(any(dto_empirical_pvalue <= 0.01)) |>
694
+ distinct(binding_id) |>
695
+ pull(binding_id)
696
+
697
+ passing_cc_mindel_reps = str_remove(passing_cc_reps, "BrentLab/callingcards;annotated_feature_reprocess_mindel;")
698
+
699
+ genome_map_replicate_meta_mindel_combined = genome_map_replicate_meta |>
700
+ filter(id %in% passing_cc_mindel_reps) |>
701
+ group_by(regulator_locus_tag, regulator_symbol, condition) |>
702
+ mutate(id = as.character(id)) |>
703
+ reframe(combined_id = if (n() > 1) paste(id, collapse = "-") else id)
704
+
705
+ # # Run analysis with deduplication (default for calling cards)
706
+ results_combined <- map(genome_map_replicate_meta_mindel_combined$combined_id, ~{
707
+ # get list of ids (might just be 1)
708
+ ids <- as.integer(strsplit(.x, "-")[[1]])
709
+ ids <- ids[!is.na(ids)]
710
+
711
+ # for each id, produce a GRanges
712
+ combined_passing_set <- map(ids, ~{
713
+ genome_map_replicate_ds |>
714
+ filter(id == .x) |>
715
+ collect() |>
716
+ dplyr::rename(score = depth) |>
717
+ relocate(chr, start, end, id, score, strand) |>
718
+ mutate(depth = scales::rescale(score, to = c(1, 1000))) |>
719
+ bed_to_granges() |>
720
+ deduplicate_granges()
721
+ })
722
+
723
+ # combine the list into a single gr
724
+ combined_gr <- do.call(c, combined_passing_set)
725
+
726
+ enrichment_analysis(
727
+ experiment_gr = combined_gr,
728
+ background_gr = background_gr,
729
+ regions_gr = regions_gr,
730
+ deduplicate_experiment = FALSE,
731
+ pseudocount = 0.1
732
+ )
733
+ })
734
+ names(results_combined) = genome_map_replicate_meta_mindel_combined$combined_id
735
+
736
+ results_combined_analysis_df = bind_rows(map(results_combined, as_tibble), .id = "combined_id") |>
737
+ left_join(genome_map_replicate_meta_mindel_combined) |>
738
+ select(combined_id,
739
+ regulator_locus_tag, regulator_symbol, condition,
740
+ target_locus_tag, target_symbol, experiment_hops, background_hops,
741
+ total_background_hops, total_experiment_hops,
742
+ callingcards_enrichment,
743
+ poisson_pval, log_poisson_pval, poisson_qval,
744
+ hypergeometric_pval, log_hypergeometric_pval, hypergeometric_qval) |>
745
+ filter(condition == "standard")
746
+
747
+ # results_combined_analysis_df |>
748
+ # ungroup() |>
749
+ # dplyr::select(-condition) |>
750
+ # arrange(regulator_locus_tag) |>
751
+ # write_parquet(
752
+ # "/home/chase/code/hf/callingcards/annotated_feature_reprocess_mindel_analysis.parquet",
753
+ # compression = "zstd",
754
+ # write_statistics = TRUE,
755
+ # use_dictionary = TRUE
756
+ # )