adding two new promoter af datasets
Browse files- README.md +119 -4
- chec_mahendrawada_m2025_af_combined_intergenic.parquet +3 -0
- chec_mahendrawada_m2025_af_combined_start_codon_500bp.parquet +3 -0
- chec_mahendrawada_m2025_af_replicates_intergenic.parquet +3 -0
- chec_mahendrawada_m2025_af_replicates_start_codon_500bp.parquet +3 -0
- scripts/mahendrawada_annotated_features.R +232 -74
README.md
CHANGED
|
@@ -467,11 +467,30 @@ features:
|
|
| 467 |
- compound: peptone
|
| 468 |
concentration_percent: 2
|
| 469 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 470 |
- applies_to:
|
| 471 |
- chec_mahendrawada_m2025_af_replicates
|
| 472 |
- chec_mahendrawada_m2025_af_combined
|
| 473 |
- chec_mahendrawada_m2025_af_replicates_mindel
|
| 474 |
- chec_mahendrawada_m2025_af_combined_mindel
|
|
|
|
|
|
|
|
|
|
|
|
|
| 475 |
fields:
|
| 476 |
- name: seqnames
|
| 477 |
dtype: string
|
|
@@ -621,7 +640,9 @@ configs:
|
|
| 621 |
- config_name: mahendrawada_chec_seq
|
| 622 |
description: >-
|
| 623 |
ChEC-seq transcription factor binding data with peak scores
|
| 624 |
-
(original authors' processed data)
|
|
|
|
|
|
|
| 625 |
default: true
|
| 626 |
dataset_type: annotated_features
|
| 627 |
metadata_fields:
|
|
@@ -635,8 +656,9 @@ configs:
|
|
| 635 |
- name: sample_id
|
| 636 |
dtype: integer
|
| 637 |
description: >-
|
| 638 |
-
|
| 639 |
-
|
|
|
|
| 640 |
- name: peak_score
|
| 641 |
dtype: float64
|
| 642 |
description: >-
|
|
@@ -648,7 +670,7 @@ configs:
|
|
| 648 |
Sample-level metadata for ChEC-seq experiments including regulator information,
|
| 649 |
experimental conditions, and replicate structure
|
| 650 |
dataset_type: metadata
|
| 651 |
-
applies_to: ["chec_mahendrawada_m2025_af_replicates", "chec_mahendrawada_m2025_af_replicates_mindel", "chec_genome_map"]
|
| 652 |
data_files:
|
| 653 |
- split: train
|
| 654 |
path: chec_genome_map_meta.parquet
|
|
@@ -810,6 +832,52 @@ configs:
|
|
| 810 |
description: SRA (Sequence Read Archive) accession identifier for this biological replicate
|
| 811 |
role: sample_id
|
| 812 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 813 |
- config_name: chec_mahendrawada_m2025_af_combined_meta
|
| 814 |
description: Sample-level metadata for combined ChEC-seq experiments with regulator information and experimental conditions
|
| 815 |
dataset_type: metadata
|
|
@@ -868,6 +936,53 @@ configs:
|
|
| 868 |
for a given regulator and condition prior to having promoter enrichment
|
| 869 |
and significance calculated.
|
| 870 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 871 |
- config_name: rna_seq
|
| 872 |
description: Nascent RNA-seq differential expression data following transcription factor depletion using 4TU metabolic labeling
|
| 873 |
dataset_type: annotated_features
|
|
|
|
| 467 |
- compound: peptone
|
| 468 |
concentration_percent: 2
|
| 469 |
|
| 470 |
+
- applies_to:
|
| 471 |
+
- chec_mahendrawada_m2025_af_replicates_intergenic
|
| 472 |
+
- chec_mahendrawada_m2025_af_combined_intergenic
|
| 473 |
+
fields:
|
| 474 |
+
- name: ir_name
|
| 475 |
+
dtype: string
|
| 476 |
+
description: >-
|
| 477 |
+
Unique identifier of the intergenic region. See
|
| 478 |
+
yeast_genome_resources/intergenic_regions_metadata_5_1.csv for details on
|
| 479 |
+
the region (location, etc). Note that these intergenic regions are defined
|
| 480 |
+
as the region between the end of one ORF and the start of the next, and
|
| 481 |
+
are named according to the locus tags of the flanking ORFs (e.g.,
|
| 482 |
+
YAL001C-YAL002W). A intergenic region is assigned to a promoter only when
|
| 483 |
+
the 5' end is continuous with the region.
|
| 484 |
+
|
| 485 |
- applies_to:
|
| 486 |
- chec_mahendrawada_m2025_af_replicates
|
| 487 |
- chec_mahendrawada_m2025_af_combined
|
| 488 |
- chec_mahendrawada_m2025_af_replicates_mindel
|
| 489 |
- chec_mahendrawada_m2025_af_combined_mindel
|
| 490 |
+
- chec_mahendrawada_m2025_af_replicates_start_codon_500bp
|
| 491 |
+
- chec_mahendrawada_m2025_af_combined_start_codon_500bp
|
| 492 |
+
- chec_mahendrawada_m2025_af_replicates_intergenic
|
| 493 |
+
- chec_mahendrawada_m2025_af_combined_intergenic
|
| 494 |
fields:
|
| 495 |
- name: seqnames
|
| 496 |
dtype: string
|
|
|
|
| 640 |
- config_name: mahendrawada_chec_seq
|
| 641 |
description: >-
|
| 642 |
ChEC-seq transcription factor binding data with peak scores
|
| 643 |
+
(original authors' processed data). Note that this is the only the standard
|
| 644 |
+
condition data for the 178 transcription factors in that condition in the
|
| 645 |
+
original authors' processed data.
|
| 646 |
default: true
|
| 647 |
dataset_type: annotated_features
|
| 648 |
metadata_fields:
|
|
|
|
| 656 |
- name: sample_id
|
| 657 |
dtype: integer
|
| 658 |
description: >-
|
| 659 |
+
NOTE: this needs to be checked -- I think it should be deprecated/removed and
|
| 660 |
+
replaced with the sample_id in the chec_genome_map_meta. This dataset was
|
| 661 |
+
not used for awhile as the rest of the repo developed.
|
| 662 |
- name: peak_score
|
| 663 |
dtype: float64
|
| 664 |
description: >-
|
|
|
|
| 670 |
Sample-level metadata for ChEC-seq experiments including regulator information,
|
| 671 |
experimental conditions, and replicate structure
|
| 672 |
dataset_type: metadata
|
| 673 |
+
applies_to: ["chec_mahendrawada_m2025_af_replicates", "chec_mahendrawada_m2025_af_replicates_mindel", "chec_mahendrawada_m2025_af_replicates_start_codon_500bp", "chec_mahendrawada_m2025_af_replicates_intergenic", "chec_genome_map"]
|
| 674 |
data_files:
|
| 675 |
- split: train
|
| 676 |
path: chec_genome_map_meta.parquet
|
|
|
|
| 832 |
description: SRA (Sequence Read Archive) accession identifier for this biological replicate
|
| 833 |
role: sample_id
|
| 834 |
|
| 835 |
+
- config_name: chec_mahendrawada_m2025_af_replicates_start_codon_500bp
|
| 836 |
+
description: >-
|
| 837 |
+
Promoter significance scores using promoters defined as 500bp upstream of the
|
| 838 |
+
start codon. See scripts/mahendrawada_annotated_features.R. This is a reprocessing
|
| 839 |
+
of the original authors' data which counts all tags over a specific promoter
|
| 840 |
+
region in the TF tagged sample and calculates an enrichment relative to the free
|
| 841 |
+
MNase control.
|
| 842 |
+
dataset_type: annotated_features
|
| 843 |
+
genome_resources:
|
| 844 |
+
region_sets:
|
| 845 |
+
start_codon_500bp:
|
| 846 |
+
path: https://huggingface.co/datasets/BrentLab/yeast_genome_resources/blob/main/start_codon_500bp_upstream_promoters.bed
|
| 847 |
+
join_column: target_locus_tag
|
| 848 |
+
data_files:
|
| 849 |
+
- split: train
|
| 850 |
+
path: chec_mahendrawada_m2025_af_replicates_start_codon_500bp.parquet
|
| 851 |
+
dataset_info:
|
| 852 |
+
features:
|
| 853 |
+
- name: sra_accession
|
| 854 |
+
dtype: string
|
| 855 |
+
description: SRA (Sequence Read Archive) accession identifier for this biological replicate
|
| 856 |
+
role: sample_id
|
| 857 |
+
|
| 858 |
+
- config_name: chec_mahendrawada_m2025_af_replicates_intergenic
|
| 859 |
+
description: >-
|
| 860 |
+
Promoter significance scores using intergenic regions that are continuous with
|
| 861 |
+
the 5' end of a target feature. See scripts/mahendrawada_annotated_features.R.
|
| 862 |
+
This is a reprocessing of the original authors' data which counts all tags over a
|
| 863 |
+
specific promoter region in the TF tagged sample and calculates an enrichment
|
| 864 |
+
relative to the free MNase control.
|
| 865 |
+
dataset_type: annotated_features
|
| 866 |
+
genome_resources:
|
| 867 |
+
region_sets:
|
| 868 |
+
intergenic:
|
| 869 |
+
path: https://huggingface.co/datasets/BrentLab/yeast_genome_resources/blob/main/intergenic_regions_metadata_5_1.csv
|
| 870 |
+
join_column: ir_name
|
| 871 |
+
data_files:
|
| 872 |
+
- split: train
|
| 873 |
+
path: chec_mahendrawada_m2025_af_replicates_intergenic.parquet
|
| 874 |
+
dataset_info:
|
| 875 |
+
features:
|
| 876 |
+
- name: sra_accession
|
| 877 |
+
dtype: string
|
| 878 |
+
description: SRA (Sequence Read Archive) accession identifier for this biological replicate
|
| 879 |
+
role: sample_id
|
| 880 |
+
|
| 881 |
- config_name: chec_mahendrawada_m2025_af_combined_meta
|
| 882 |
description: Sample-level metadata for combined ChEC-seq experiments with regulator information and experimental conditions
|
| 883 |
dataset_type: metadata
|
|
|
|
| 936 |
for a given regulator and condition prior to having promoter enrichment
|
| 937 |
and significance calculated.
|
| 938 |
|
| 939 |
+
- config_name: chec_mahendrawada_m2025_af_combined_start_codon_500bp
|
| 940 |
+
description: >-
|
| 941 |
+
Annotated feature dataset with binding score and statistics performed on combined
|
| 942 |
+
replicates for a single sample per regulator/condition, using promoters defined as
|
| 943 |
+
500bp upstream of the start codon. See scripts/mahendrawada_annotated_features.R.
|
| 944 |
+
dataset_type: annotated_features
|
| 945 |
+
genome_resources:
|
| 946 |
+
region_sets:
|
| 947 |
+
start_codon_500bp:
|
| 948 |
+
path: https://huggingface.co/datasets/BrentLab/yeast_genome_resources/blob/main/start_codon_500bp_upstream_promoters.bed
|
| 949 |
+
join_column: target_locus_tag
|
| 950 |
+
data_files:
|
| 951 |
+
- split: train
|
| 952 |
+
path: chec_mahendrawada_m2025_af_combined_start_codon_500bp.parquet
|
| 953 |
+
dataset_info:
|
| 954 |
+
features:
|
| 955 |
+
- name: sample_id
|
| 956 |
+
dtype: int64
|
| 957 |
+
description: >-
|
| 958 |
+
Unique identifier for a sample. Each sample is the combination of replicates
|
| 959 |
+
for a given regulator and condition prior to having promoter enrichment
|
| 960 |
+
and significance calculated.
|
| 961 |
+
|
| 962 |
+
- config_name: chec_mahendrawada_m2025_af_combined_intergenic
|
| 963 |
+
description: >-
|
| 964 |
+
Annotated feature dataset with binding score and statistics performed on combined
|
| 965 |
+
replicates for a single sample per regulator/condition, using intergenic regions
|
| 966 |
+
that are continuous with the 5' end of a target feature.
|
| 967 |
+
See scripts/mahendrawada_annoted_features.R.
|
| 968 |
+
dataset_type: annotated_features
|
| 969 |
+
genome_resources:
|
| 970 |
+
region_sets:
|
| 971 |
+
intergenic:
|
| 972 |
+
path: https://huggingface.co/datasets/BrentLab/yeast_genome_resources/blob/main/intergenic_regions_metadata_5_1.csv
|
| 973 |
+
join_column: ir_name
|
| 974 |
+
data_files:
|
| 975 |
+
- split: train
|
| 976 |
+
path: chec_mahendrawada_m2025_af_combined_intergenic.parquet
|
| 977 |
+
dataset_info:
|
| 978 |
+
features:
|
| 979 |
+
- name: sample_id
|
| 980 |
+
dtype: int64
|
| 981 |
+
description: >-
|
| 982 |
+
Unique identifier for a sample. Each sample is the combination of replicates
|
| 983 |
+
for a given regulator and condition prior to having promoter enrichment
|
| 984 |
+
and significance calculated.
|
| 985 |
+
|
| 986 |
- config_name: rna_seq
|
| 987 |
description: Nascent RNA-seq differential expression data following transcription factor depletion using 4TU metabolic labeling
|
| 988 |
dataset_type: annotated_features
|
chec_mahendrawada_m2025_af_combined_intergenic.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3965e354a9d39bcd0c717998e94613696e5c677519608e6ebeafd3a7aba57c9e
|
| 3 |
+
size 67168608
|
chec_mahendrawada_m2025_af_combined_start_codon_500bp.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8027a224f1dafc0ad00b0e471f765ed1c436fc2cfa1d883d7dfab482f51a262e
|
| 3 |
+
size 74534135
|
chec_mahendrawada_m2025_af_replicates_intergenic.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:236ca43bfc9c8025cc7f4d900e2ada144df6d994383785e47a8fb7f33ebf2ab5
|
| 3 |
+
size 200162982
|
chec_mahendrawada_m2025_af_replicates_start_codon_500bp.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61fb0dd266901ed76d27cc221609ace595c6b550f5ec885a355f78a653dff318
|
| 3 |
+
size 221640272
|
scripts/mahendrawada_annotated_features.R
CHANGED
|
@@ -475,7 +475,7 @@ enrichment_analysis <- function(sampleid,
|
|
| 475 |
)
|
| 476 |
}
|
| 477 |
|
| 478 |
-
|
| 479 |
|
| 480 |
genomic_features = arrow::read_parquet("~/code/hf/yeast_genome_resources/brentlab_features.parquet")
|
| 481 |
|
|
@@ -495,48 +495,254 @@ samplid_list = chec_genomemap_meta %>%
|
|
| 495 |
pull(sample_id) %>%
|
| 496 |
unique()
|
| 497 |
|
| 498 |
-
|
| 499 |
yiming = read_tsv("~/code/hf/yeast_genome_resources/yiming_promoters.bed",
|
| 500 |
col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
|
| 501 |
bed_to_granges(),
|
| 502 |
mindel = arrow::read_parquet("~/code/hf/yeast_genome_resources/mindel_promoters.parquet",
|
| 503 |
col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
|
| 504 |
-
bed_to_granges()
|
|
|
|
|
|
|
| 505 |
)
|
| 506 |
|
| 507 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 508 |
|
| 509 |
# removes AAD6 and AAD16 from mindel. pseudogene no longer in annotations
|
| 510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
|
| 512 |
m2025_control = combine_control_af()
|
| 513 |
|
| 514 |
-
annotated_feature_counts = map(samplid_list, combine_replicates_af)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 515 |
names(annotated_feature_counts) = samplid_list
|
| 516 |
|
| 517 |
-
annotated_feature_quants = map(
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
)
|
| 526 |
|
| 527 |
names(annotated_feature_quants) = samplid_list
|
| 528 |
|
| 529 |
sra_accession_for_quants = map(annotated_feature_quants, ~names(.x$replicates))
|
| 530 |
|
| 531 |
-
|
| 532 |
map(annotated_feature_quants, ~{
|
| 533 |
map(.x$replicates, as_tibble) %>%
|
| 534 |
list_rbind(names_to = "sra_accession")}) %>%
|
| 535 |
list_rbind(names_to = "sample_id") %>%
|
| 536 |
mutate(sample_id = as.integer(sample_id)) %>%
|
| 537 |
arrange(sample_id) %>%
|
| 538 |
-
select(-sample_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
dplyr::relocate(sra_accession, target_locus_tag, target_symbol)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 540 |
|
| 541 |
# annotated_features_quants_replicates =
|
| 542 |
# map(annotated_feature_quants, ~{
|
|
@@ -552,31 +758,7 @@ annotated_features_quants_replicates_mindel =
|
|
| 552 |
# select(-score)
|
| 553 |
#
|
| 554 |
|
| 555 |
-
|
| 556 |
-
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates.parquet",
|
| 557 |
-
# compression = "zstd",
|
| 558 |
-
# write_statistics = TRUE,
|
| 559 |
-
# chunk_size = 6708,
|
| 560 |
-
# use_dictionary = c(
|
| 561 |
-
# sra_accession = TRUE,
|
| 562 |
-
# seqnames = TRUE,
|
| 563 |
-
# target_locus_tag = TRUE,
|
| 564 |
-
# target_symbol = TRUE
|
| 565 |
-
# )
|
| 566 |
-
# )
|
| 567 |
-
|
| 568 |
-
# annotated_features_quants_replicates_mindel %>%
|
| 569 |
-
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates_mindel.parquet",
|
| 570 |
-
# compression = "zstd",
|
| 571 |
-
# write_statistics = TRUE,
|
| 572 |
-
# chunk_size = 5358,
|
| 573 |
-
# use_dictionary = c(
|
| 574 |
-
# sra_accession = TRUE,
|
| 575 |
-
# seqnames = TRUE,
|
| 576 |
-
# target_locus_tag = TRUE,
|
| 577 |
-
# target_symbol = TRUE
|
| 578 |
-
# )
|
| 579 |
-
# )
|
| 580 |
|
| 581 |
# annotated_feature_quants_combined =
|
| 582 |
# map(annotated_feature_quants, ~as_tibble(.x$combined)) %>%
|
|
@@ -588,36 +770,12 @@ annotated_features_quants_replicates_mindel =
|
|
| 588 |
# dplyr::relocate(sample_id, target_locus_tag, target_symbol) %>%
|
| 589 |
# select(-score)
|
| 590 |
|
| 591 |
-
annotated_feature_quants_combined_mindel =
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
# compression = "zstd",
|
| 601 |
-
# write_statistics = TRUE,
|
| 602 |
-
# chunk_size = 5358,
|
| 603 |
-
# use_dictionary = c(
|
| 604 |
-
# sample_id = TRUE,
|
| 605 |
-
# seqnames = TRUE,
|
| 606 |
-
# target_locus_tag = TRUE,
|
| 607 |
-
# target_symbol = TRUE
|
| 608 |
-
# )
|
| 609 |
-
# )
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
# annotated_feature_quants_combined %>%
|
| 613 |
-
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_combined.parquet",
|
| 614 |
-
# compression = "zstd",
|
| 615 |
-
# write_statistics = TRUE,
|
| 616 |
-
# chunk_size = 6708,
|
| 617 |
-
# use_dictionary = c(
|
| 618 |
-
# sample_id = TRUE,
|
| 619 |
-
# seqnames = TRUE,
|
| 620 |
-
# target_locus_tag = TRUE,
|
| 621 |
-
# target_symbol = TRUE
|
| 622 |
-
# )
|
| 623 |
-
# )
|
|
|
|
| 475 |
)
|
| 476 |
}
|
| 477 |
|
| 478 |
+
PROMOTERS = 'start_codon_500bp'
|
| 479 |
|
| 480 |
genomic_features = arrow::read_parquet("~/code/hf/yeast_genome_resources/brentlab_features.parquet")
|
| 481 |
|
|
|
|
| 495 |
pull(sample_id) %>%
|
| 496 |
unique()
|
| 497 |
|
| 498 |
+
regions_list = list(
|
| 499 |
yiming = read_tsv("~/code/hf/yeast_genome_resources/yiming_promoters.bed",
|
| 500 |
col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
|
| 501 |
bed_to_granges(),
|
| 502 |
mindel = arrow::read_parquet("~/code/hf/yeast_genome_resources/mindel_promoters.parquet",
|
| 503 |
col_names = c('chr', 'start', 'end', 'locus_tag', 'score', 'strand')) %>%
|
| 504 |
+
bed_to_granges(),
|
| 505 |
+
start_codon_500bp = rtracklayer::import("~/code/hf/yeast_genome_resources/start_codon_500bp_upstream_promoters.bed"),
|
| 506 |
+
intergenic = rtracklayer::import("~/code/hf/yeast_genome_resources/intergenic_regions_5_1.bed")
|
| 507 |
)
|
| 508 |
|
| 509 |
+
# rename name to target_locus_tag
|
| 510 |
+
colnames(GenomicRanges::mcols(regions_list$yiming))[1] <- "target_locus_tag"
|
| 511 |
+
colnames(GenomicRanges::mcols(regions_list$start_codon_500bp))[1] <- "target_locus_tag"
|
| 512 |
+
|
| 513 |
+
intergenic_meta = read_csv("~/code/hf/yeast_genome_resources/intergenic_regions_metadata_5_1.csv") |>
|
| 514 |
+
dplyr::select(ir_name, chr, start, end, feature_left, feature_right) |>
|
| 515 |
+
pivot_longer(-c(ir_name, chr, start, end), names_to = 'side', values_to = 'target_locus_tag') |>
|
| 516 |
+
left_join(dplyr::select(genomic_features, target_locus_tag = locus_tag,
|
| 517 |
+
target_symbol = symbol, target_strand = strand,
|
| 518 |
+
target_start = start, target_end = end)) |>
|
| 519 |
+
filter(chr != "chrM") |>
|
| 520 |
+
filter(!is.na(target_strand)) |>
|
| 521 |
+
mutate(valid = (target_strand == '-' & target_end <= start)
|
| 522 |
+
| (target_strand == '+' & target_start >= end)) |>
|
| 523 |
+
filter(valid)
|
| 524 |
+
|
| 525 |
+
regions_gr <- regions_list[[PROMOTERS]]
|
| 526 |
|
| 527 |
# removes AAD6 and AAD16 from mindel. pseudogene no longer in annotations
|
| 528 |
+
if(PROMOTERS != "intergenic"){
|
| 529 |
+
# really just for mindel
|
| 530 |
+
regions_gr = regions_gr[!is.na(regions_gr$target_locus_tag)]
|
| 531 |
+
} else if(PROMOTERS == "intergenic"){
|
| 532 |
+
regions_gr = regions_gr[regions_gr$name %in% unique(intergenic_meta$ir_name)]
|
| 533 |
+
}
|
| 534 |
|
| 535 |
m2025_control = combine_control_af()
|
| 536 |
|
| 537 |
+
# annotated_feature_counts = map(samplid_list, combine_replicates_af)
|
| 538 |
+
library(parallel)
|
| 539 |
+
|
| 540 |
+
n_cores = 25
|
| 541 |
+
annotated_feature_counts <- mclapply(
|
| 542 |
+
samplid_list,
|
| 543 |
+
combine_replicates_af,
|
| 544 |
+
mc.cores = n_cores
|
| 545 |
+
)
|
| 546 |
names(annotated_feature_counts) = samplid_list
|
| 547 |
|
| 548 |
+
# annotated_feature_quants = map(
|
| 549 |
+
# samplid_list, ~{
|
| 550 |
+
# enrichment_analysis(
|
| 551 |
+
# .x,
|
| 552 |
+
# m2025_control$af$score,
|
| 553 |
+
# sum(m2025_control$library_totals$n)
|
| 554 |
+
# )
|
| 555 |
+
# }
|
| 556 |
+
# )
|
| 557 |
+
|
| 558 |
+
|
| 559 |
+
annotated_feature_quants <- mclapply(
|
| 560 |
+
samplid_list,
|
| 561 |
+
\(x) enrichment_analysis(
|
| 562 |
+
x,
|
| 563 |
+
m2025_control$af$score,
|
| 564 |
+
sum(m2025_control$library_totals$n)
|
| 565 |
+
),
|
| 566 |
+
mc.cores = n_cores
|
| 567 |
)
|
| 568 |
|
| 569 |
names(annotated_feature_quants) = samplid_list
|
| 570 |
|
| 571 |
sra_accession_for_quants = map(annotated_feature_quants, ~names(.x$replicates))
|
| 572 |
|
| 573 |
+
annotated_features_quants_replicates_raw =
|
| 574 |
map(annotated_feature_quants, ~{
|
| 575 |
map(.x$replicates, as_tibble) %>%
|
| 576 |
list_rbind(names_to = "sra_accession")}) %>%
|
| 577 |
list_rbind(names_to = "sample_id") %>%
|
| 578 |
mutate(sample_id = as.integer(sample_id)) %>%
|
| 579 |
arrange(sample_id) %>%
|
| 580 |
+
select(-sample_id)
|
| 581 |
+
|
| 582 |
+
if(PROMOTERS == "intergenic"){
|
| 583 |
+
annotated_features_quants_replicates = annotated_features_quants_replicates_raw |>
|
| 584 |
+
dplyr::rename(ir_name = name) |>
|
| 585 |
+
left_join(dplyr::select(intergenic_meta, ir_name, target_locus_tag, target_symbol),
|
| 586 |
+
relationship = "many-to-many")
|
| 587 |
+
} else if(PROMOTERS == "yiming" | PROMOTERS == "start_codon_500bp"){
|
| 588 |
+
annotated_features_quants_replicates = annotated_features_quants_replicates_raw |>
|
| 589 |
+
left_join(dplyr::select(genomic_features, target_locus_tag = locus_tag, target_symbol = symbol)) |>
|
| 590 |
+
dplyr::relocate(sra_accession, target_locus_tag, target_symbol)
|
| 591 |
+
|
| 592 |
+
} else{
|
| 593 |
+
annotated_features_quants_replicates = annotated_features_quants_replicates_raw |>
|
| 594 |
dplyr::relocate(sra_accession, target_locus_tag, target_symbol)
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
annotated_feature_quants_combined_raw =
|
| 598 |
+
map(annotated_feature_quants, ~as_tibble(.x$combined)) %>%
|
| 599 |
+
list_rbind(names_to = "sample_id") %>%
|
| 600 |
+
mutate(sample_id = as.integer(sample_id)) %>%
|
| 601 |
+
arrange(sample_id)
|
| 602 |
+
|
| 603 |
+
if(PROMOTERS == "intergenic"){
|
| 604 |
+
annotated_feature_quants_combined = annotated_feature_quants_combined_raw |>
|
| 605 |
+
dplyr::rename(ir_name = name) |>
|
| 606 |
+
left_join(dplyr::select(intergenic_meta, ir_name, target_locus_tag, target_symbol),
|
| 607 |
+
relationship = "many-to-many") |>
|
| 608 |
+
dplyr::relocate(sample_id, target_locus_tag, target_symbol, ir_name)
|
| 609 |
+
} else if(PROMOTERS == "yiming" | PROMOTERS == "start_codon_500bp"){
|
| 610 |
+
annotated_feature_quants_combined = annotated_feature_quants_combined_raw |>
|
| 611 |
+
left_join(dplyr::select(genomic_features, target_locus_tag = locus_tag, target_symbol = symbol)) |>
|
| 612 |
+
dplyr::relocate(sample_id, target_locus_tag, target_symbol)
|
| 613 |
+
|
| 614 |
+
} else{
|
| 615 |
+
annotated_feature_quants_combined = annotated_feature_quants_combined_raw |>
|
| 616 |
+
dplyr::relocate(sample_id, target_locus_tag, target_symbol)
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
if(PROMOTERS == 'yiming'){
|
| 620 |
+
# annotated_features_quants_replicates %>%
|
| 621 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates.parquet",
|
| 622 |
+
# compression = "zstd",
|
| 623 |
+
# write_statistics = TRUE,
|
| 624 |
+
# chunk_size = 6708,
|
| 625 |
+
# use_dictionary = c(
|
| 626 |
+
# sra_accession = TRUE,
|
| 627 |
+
# seqnames = TRUE,
|
| 628 |
+
# target_locus_tag = TRUE,
|
| 629 |
+
# target_symbol = TRUE
|
| 630 |
+
# )
|
| 631 |
+
# )
|
| 632 |
+
#
|
| 633 |
+
# annotated_feature_quants_combined %>%
|
| 634 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_combined.parquet",
|
| 635 |
+
# compression = "zstd",
|
| 636 |
+
# write_statistics = TRUE,
|
| 637 |
+
# chunk_size = 6708,
|
| 638 |
+
# use_dictionary = c(
|
| 639 |
+
# sample_id = TRUE,
|
| 640 |
+
# seqnames = TRUE,
|
| 641 |
+
# target_locus_tag = TRUE,
|
| 642 |
+
# target_symbol = TRUE
|
| 643 |
+
# )
|
| 644 |
+
# )
|
| 645 |
+
|
| 646 |
+
} else if(PROMOTERS == 'mindel'){
|
| 647 |
+
# annotated_features_quants_replicates_mindel %>%
|
| 648 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates_mindel.parquet",
|
| 649 |
+
# compression = "zstd",
|
| 650 |
+
# write_statistics = TRUE,
|
| 651 |
+
# chunk_size = 5358,
|
| 652 |
+
# use_dictionary = c(
|
| 653 |
+
# sra_accession = TRUE,
|
| 654 |
+
# seqnames = TRUE,
|
| 655 |
+
# target_locus_tag = TRUE,
|
| 656 |
+
# target_symbol = TRUE
|
| 657 |
+
# )
|
| 658 |
+
# )
|
| 659 |
+
#
|
| 660 |
+
# annotated_feature_quants_combined_mindel %>%
|
| 661 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_combined_mindel.parquet",
|
| 662 |
+
# compression = "zstd",
|
| 663 |
+
# write_statistics = TRUE,
|
| 664 |
+
# chunk_size = 5358,
|
| 665 |
+
# use_dictionary = c(
|
| 666 |
+
# sample_id = TRUE,
|
| 667 |
+
# seqnames = TRUE,
|
| 668 |
+
# target_locus_tag = TRUE,
|
| 669 |
+
# target_symbol = TRUE
|
| 670 |
+
# )
|
| 671 |
+
# )
|
| 672 |
+
|
| 673 |
+
} else if(PROMOTERS == 'start_codon_500bp'){
|
| 674 |
+
# annotated_features_quants_replicates %>%
|
| 675 |
+
# dplyr::select(-score) |>
|
| 676 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates_start_codon_500bp.parquet",
|
| 677 |
+
# compression = "zstd",
|
| 678 |
+
# write_statistics = TRUE,
|
| 679 |
+
# chunk_size = 5945,
|
| 680 |
+
# use_dictionary = c(
|
| 681 |
+
# sra_accession = TRUE,
|
| 682 |
+
# seqnames = TRUE,
|
| 683 |
+
# target_locus_tag = TRUE,
|
| 684 |
+
# target_symbol = TRUE
|
| 685 |
+
# )
|
| 686 |
+
# )
|
| 687 |
+
#
|
| 688 |
+
# annotated_feature_quants_combined %>%
|
| 689 |
+
# dplyr::select(-score) |>
|
| 690 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_combined_start_codon_500bp.parquet",
|
| 691 |
+
# compression = "zstd",
|
| 692 |
+
# write_statistics = TRUE,
|
| 693 |
+
# chunk_size = 5945,
|
| 694 |
+
# use_dictionary = c(
|
| 695 |
+
# sample_id = TRUE,
|
| 696 |
+
# seqnames = TRUE,
|
| 697 |
+
# target_locus_tag = TRUE,
|
| 698 |
+
# target_symbol = TRUE
|
| 699 |
+
# )
|
| 700 |
+
# )
|
| 701 |
+
|
| 702 |
+
} else if(PROMOTERS == 'intergenic'){
|
| 703 |
+
# annotated_features_quants_replicates %>%
|
| 704 |
+
# dplyr::select(-score) |>
|
| 705 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_replicates_intergenic.parquet",
|
| 706 |
+
# compression = "zstd",
|
| 707 |
+
# write_statistics = TRUE,
|
| 708 |
+
# chunk_size = 6040,
|
| 709 |
+
# use_dictionary = c(
|
| 710 |
+
# sra_accession = TRUE,
|
| 711 |
+
# seqnames = TRUE,
|
| 712 |
+
# ir_name = TRUE,
|
| 713 |
+
# target_locus_tag = TRUE,
|
| 714 |
+
# target_symbol = TRUE
|
| 715 |
+
# )
|
| 716 |
+
# )
|
| 717 |
+
#
|
| 718 |
+
# annotated_feature_quants_combined %>%
|
| 719 |
+
# dplyr::select(-score) |>
|
| 720 |
+
# write_parquet("~/code/hf/mahendrawada_2025/chec_mahendrawada_m2025_af_combined_intergenic.parquet",
|
| 721 |
+
# compression = "zstd",
|
| 722 |
+
# write_statistics = TRUE,
|
| 723 |
+
# chunk_size = 6040,
|
| 724 |
+
# use_dictionary = c(
|
| 725 |
+
# sample_id = TRUE,
|
| 726 |
+
# seqnames = TRUE,
|
| 727 |
+
# ir_name = TRUE,
|
| 728 |
+
# target_locus_tag = TRUE,
|
| 729 |
+
# target_symbol = TRUE
|
| 730 |
+
# )
|
| 731 |
+
# )
|
| 732 |
+
|
| 733 |
+
}
|
| 734 |
+
|
| 735 |
+
|
| 736 |
+
|
| 737 |
+
# annotated_features_quants_replicates_mindel =
|
| 738 |
+
# map(annotated_feature_quants, ~{
|
| 739 |
+
# map(.x$replicates, as_tibble) %>%
|
| 740 |
+
# list_rbind(names_to = "sra_accession")}) %>%
|
| 741 |
+
# list_rbind(names_to = "sample_id") %>%
|
| 742 |
+
# mutate(sample_id = as.integer(sample_id)) %>%
|
| 743 |
+
# arrange(sample_id) %>%
|
| 744 |
+
# select(-sample_id) %>%
|
| 745 |
+
# dplyr::relocate(sra_accession, target_locus_tag, target_symbol)
|
| 746 |
|
| 747 |
# annotated_features_quants_replicates =
|
| 748 |
# map(annotated_feature_quants, ~{
|
|
|
|
| 758 |
# select(-score)
|
| 759 |
#
|
| 760 |
|
| 761 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 762 |
|
| 763 |
# annotated_feature_quants_combined =
|
| 764 |
# map(annotated_feature_quants, ~as_tibble(.x$combined)) %>%
|
|
|
|
| 770 |
# dplyr::relocate(sample_id, target_locus_tag, target_symbol) %>%
|
| 771 |
# select(-score)
|
| 772 |
|
| 773 |
+
# annotated_feature_quants_combined_mindel =
|
| 774 |
+
# map(annotated_feature_quants, ~as_tibble(.x$combined)) %>%
|
| 775 |
+
# list_rbind(names_to = "sample_id") %>%
|
| 776 |
+
# mutate(sample_id = as.integer(sample_id)) %>%
|
| 777 |
+
# arrange(sample_id) %>%
|
| 778 |
+
# dplyr::relocate(sample_id, target_locus_tag, target_symbol)
|
| 779 |
+
|
| 780 |
+
|
| 781 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|