cmatkhan commited on
Commit
25daa63
·
1 Parent(s): 1d043ec

adding rnaseq reprocessed

Browse files
README.md CHANGED
@@ -496,6 +496,75 @@ configs:
496
  dtype: float64
497
  description: Log2 fold change (IAA/DMSO) for significantly affected genes (DESeq2, padj <0.1, FC >= 1.3)
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  - config_name: degron_counts_meta
500
  description: Sample-level metadata for auxin-inducible degron perturbation experiments with HTSeq count statistics
501
  dataset_type: metadata
 
496
  dtype: float64
497
  description: Log2 fold change (IAA/DMSO) for significantly affected genes (DESeq2, padj <0.1, FC >= 1.3)
498
 
499
+ - config_name: rnaseq_reprocessed
500
+ description: Reprocessed nascent RNA-seq differential expression data using DESeq2 without thresholding, comparing IAA-induced TF degradation versus DMSO control
501
+ dataset_type: annotated_features
502
+ metadata_fields:
503
+ - regulator_locus_tag
504
+ - regulator_symbol
505
+ - sample_id
506
+ - env_condition
507
+ - timepoint
508
+ data_files:
509
+ - split: train
510
+ path: rnaseq_reprocessed.parquet
511
+ dataset_info:
512
+ features:
513
+ - name: sample_id
514
+ dtype: string
515
+ description: Composite identifier combining regulator, condition, timepoint, and treatment information from the merged IAA and DMSO sample IDs
516
+ role: sample_id
517
+ - name: regulator_locus_tag
518
+ dtype: string
519
+ description: Systematic gene identifier for the depleted transcription factor
520
+ role: regulator_identifier
521
+ - name: regulator_symbol
522
+ dtype: string
523
+ description: Standard gene symbol for the depleted transcription factor
524
+ role: regulator_identifier
525
+ - name: env_condition
526
+ dtype:
527
+ class_label:
528
+ names: ["standard_30C", "SM", "galactose", "raffinose", "heat_shock_37C"]
529
+ description: Environmental growth condition for this experiment
530
+ role: experimental_condition
531
+ - name: timepoint
532
+ dtype: float64
533
+ description: Time point in minutes (standard is 30 minutes post-treatment. very few other timepoints)
534
+ role: experimental_condition
535
+ - name: target_locus_tag
536
+ dtype: string
537
+ description: Systematic gene identifier for the differentially expressed target gene
538
+ role: target_identifier
539
+ - name: target_symbol
540
+ dtype: string
541
+ description: Standard gene symbol for the differentially expressed target gene
542
+ role: target_identifier
543
+ - name: baseMean
544
+ dtype: float64
545
+ description: Mean of normalized counts across all samples (DESeq2 output)
546
+ role: quantitative_measure
547
+ - name: log2FoldChange
548
+ dtype: float64
549
+ description: Log2 fold change IAA versus DMSO (DESeq2 output, no thresholding applied)
550
+ role: quantitative_measure
551
+ - name: lfcSE
552
+ dtype: float64
553
+ description: Standard error of the log2 fold change estimate (DESeq2 output)
554
+ role: quantitative_measure
555
+ - name: stat
556
+ dtype: float64
557
+ description: Wald test statistic (DESeq2 output)
558
+ role: quantitative_measure
559
+ - name: pvalue
560
+ dtype: float64
561
+ description: Wald test p-value (DESeq2 output)
562
+ role: quantitative_measure
563
+ - name: padj
564
+ dtype: float64
565
+ description: Benjamini-Hochberg adjusted p-value (DESeq2 output)
566
+ role: quantitative_measure
567
+
568
  - config_name: degron_counts_meta
569
  description: Sample-level metadata for auxin-inducible degron perturbation experiments with HTSeq count statistics
570
  dataset_type: metadata
rnaseq_reprocessed.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66a53db51bfadb326f663f90a9da4a64d8e4724da679ad17851a530541ea3fb4
3
+ size 43776387
scripts/rnaseq_differential_expression.R ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ library(tidyverse)
2
+ library(DESeq2)
3
+ library(arrow)
4
+ library(here)
5
+
6
+
7
+ run_degron_deseq2 <- function(regulator_sym, env_cond, timepoint_val,
8
+ degron_data = degron,
9
+ baseline_data = baseline_control) {
10
+
11
+ # Filter degron data for the specified regulator, condition, and timepoint
12
+ degron_meta_filtered <- degron_data$meta %>%
13
+ filter(
14
+ regulator_symbol == regulator_sym,
15
+ env_condition == env_cond,
16
+ timepoint == timepoint_val) %>%
17
+ mutate(degron_treatment = factor(degron_treatment,
18
+ levels = c("DMSO", "IAA")))
19
+
20
+
21
+
22
+ if (nrow(degron_meta_filtered) != 6) {
23
+ stop(sprintf("We expect exactly 3 replicates in each conditition for a total of 6 samples. These parameters result in %s", nrow(degron_meta_filtered)))
24
+ }
25
+
26
+ # Get the IAA and DMSO samples
27
+ iaa_samples <- degron_meta_filtered %>%
28
+ filter(degron_treatment == "IAA") %>%
29
+ pull(sra_accession)
30
+
31
+ dmso_samples <- degron_meta_filtered %>%
32
+ filter(degron_treatment == "DMSO") %>%
33
+ pull(sra_accession)
34
+
35
+ if (length(iaa_samples) != 3 || length(dmso_samples) != 3) {
36
+ stop("Missing IAA or DMSO samples for the specified parameters")
37
+ }
38
+
39
+ # Get counts for these samples
40
+ counts_filtered <- degron_data$counts_long %>%
41
+ filter(sra_accession %in% c(iaa_samples, dmso_samples))
42
+
43
+ # Convert to wide format (genes x samples)
44
+ counts_wide <- counts_filtered %>%
45
+ select(target_locus_tag, sra_accession, count) %>%
46
+ pivot_wider(
47
+ names_from = sra_accession,
48
+ values_from = count,
49
+ values_fill = 0) %>%
50
+ column_to_rownames("target_locus_tag")
51
+
52
+ # Create sample metadata
53
+ sample_meta <- degron_meta_filtered %>%
54
+ select(sra_accession, degron_treatment) %>%
55
+ column_to_rownames("sra_accession")
56
+
57
+ # Ensure counts columns match metadata rows
58
+ counts_wide <- counts_wide[, rownames(sample_meta)]
59
+
60
+ # Create DESeq2 dataset
61
+ dds <- DESeqDataSetFromMatrix(
62
+ countData = counts_wide,
63
+ colData = sample_meta,
64
+ design = ~ degron_treatment
65
+ )
66
+
67
+ # Run DESeq2
68
+ dds <- DESeq(dds)
69
+
70
+ # Get results
71
+ res <- results(dds)
72
+
73
+ # Return both the DESeq object and results
74
+ return(list(
75
+ dds = dds,
76
+ results = res %>%
77
+ as_tibble(rownames="target_locus_tag") %>%
78
+ mutate(sample_id = paste(unique(degron_meta_filtered$sample_id), collapse="_")) %>%
79
+ left_join(distinct(degron$counts_long %>% select(target_locus_tag, target_symbol))) %>%
80
+ mutate(regulator_locus_tag = unique(degron_meta_filtered$regulator_locus_tag),
81
+ regulator_symbol = unique(degron_meta_filtered$regulator_symbol),
82
+ env_condition = unique(degron_meta_filtered$env_condition),
83
+ timepoint = unique(degron_meta_filtered$timepoint)) %>%
84
+ dplyr::relocate(sample_id, regulator_locus_tag, regulator_symbol,
85
+ env_condition, timepoint),
86
+ metadata = degron_meta_filtered
87
+ ))
88
+ }
89
+
90
+
91
+ baseline_control = list(
92
+ counts_long = arrow::read_parquet(
93
+ "~/code/hf/mahendrawada_2025/wt_baseline_counts.parquet"),
94
+ meta = arrow::read_parquet(
95
+ "~/code/hf/mahendrawada_2025/wt_baseline_counts_meta.parquet")
96
+ )
97
+
98
+ degron = list(
99
+ counts_long = arrow::read_parquet("~/code/hf/mahendrawada_2025/degron_counts.parquet"),
100
+ meta = arrow::read_parquet("~/code/hf/mahendrawada_2025/degron_counts_meta.parquet")
101
+ )
102
+
103
+ x = map(unique(degron$meta$regulator_symbol),
104
+ ~run_degron_deseq2(., 'standard_30C', 30, degron, baseline_control))
105
+
106
+ results_df <- map_dfr(x, ~.$results)
107
+
108
+ # results_df %>%
109
+ # write_parquet("~/code/hf/mahendrawada_2025/rnaseq_reprocessed.parquet",
110
+ # compression = "zstd",
111
+ # write_statistics = TRUE,
112
+ # chunk_size = 6708,
113
+ # use_dictionary = c(
114
+ # sample_id = TRUE,
115
+ # regulator_locus_tag = TRUE,
116
+ # regulator_symbol = TRUE,
117
+ # target_locus_tag = TRUE,
118
+ # target_symbol = TRUE
119
+ # )
120
+ # )