cmatkhan commited on
Commit
1fcd609
·
verified ·
1 Parent(s): d61e6f8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/parse_mahendrawada.R +58 -41
scripts/parse_mahendrawada.R CHANGED
@@ -3,6 +3,12 @@ library(here)
3
  library(arrow)
4
  library(readxl)
5
 
 
 
 
 
 
 
6
  # genomic feature harmonization table ----
7
  # see https://huggingface.co/datasets/BrentLab/yeast_genome_resources
8
  genomicfeatures = arrow::open_dataset(here("data/genome_files/hf/features")) %>%
@@ -90,24 +96,6 @@ stopifnot(
90
  filter(!complete.cases(.) | locus_tag != gene_id) %>%
91
  nrow() == 0)
92
 
93
- mahedrawada_genomicfeatures %>%
94
- left_join(genomicfeatures %>%
95
- select(locus_tag, symbol) %>%
96
- mutate(gene_id = locus_tag)) %>%
97
- write_parquet(here("~/code/hf/mahendrawada_2025/features_mahendrawada_2025.parquet"),
98
- compression = "zstd",
99
- write_statistics = TRUE,
100
- use_dictionary = c(
101
- gene_id = TRUE,
102
- gene_name = TRUE,
103
- chr = TRUE,
104
- locus_tag = TRUE,
105
- symbol = TRUE,
106
- coactivator = TRUE
107
- )
108
- )
109
-
110
-
111
  chec_data_final = chec_data %>%
112
  left_join(
113
  genomicfeatures %>%
@@ -122,18 +110,6 @@ chec_data_final = chec_data %>%
122
  select(regulator_locus_tag, regulator_symbol, target_locus_tag, target_symbol, peak_score) %>%
123
  arrange(regulator_locus_tag, target_locus_tag)
124
 
125
- chec_data_final %>%
126
- write_parquet(here("~/code/hf/mahendrawada_2025/chec_mahendrawada_2025.parquet"),
127
- compression = "zstd",
128
- write_statistics = TRUE,
129
- use_dictionary = c(
130
- regulator_locus_tag = TRUE,
131
- regulator_symbol = TRUE,
132
- target_locus_tag = TRUE,
133
- target_symbol = TRUE
134
- )
135
- )
136
-
137
  rnaseq_data_final = rnaseq_data %>%
138
  left_join(
139
  genomicfeatures %>%
@@ -148,14 +124,55 @@ rnaseq_data_final = rnaseq_data %>%
148
  select(regulator_locus_tag, regulator_symbol, target_locus_tag, target_symbol, log2fc) %>%
149
  arrange(regulator_locus_tag, target_locus_tag)
150
 
151
- rnaseq_data_final %>%
152
- write_parquet(here("~/code/hf/mahendrawada_2025/rnaseq_mahendrawada_2025.parquet"),
153
- compression = "zstd",
154
- write_statistics = TRUE,
155
- use_dictionary = c(
156
- regulator_locus_tag = TRUE,
157
- regulator_symbol = TRUE,
158
- target_locus_tag = TRUE,
159
- target_symbol = TRUE
160
- )
161
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  library(arrow)
4
  library(readxl)
5
 
6
+ # from fetchngs, the multiqc metadata has an easy way to map between
7
+ # accessions and samples
8
+ multqc_chec_config = yaml::read_yaml("~/Downloads/multiqc_config.yml")
9
+ chec_meta <- map_dfr(multqc_chec_config$sample_names_rename,
10
+ ~tibble(!!!setNames(., multqc_chec_config$sample_names_rename_buttons)))
11
+
12
  # genomic feature harmonization table ----
13
  # see https://huggingface.co/datasets/BrentLab/yeast_genome_resources
14
  genomicfeatures = arrow::open_dataset(here("data/genome_files/hf/features")) %>%
 
96
  filter(!complete.cases(.) | locus_tag != gene_id) %>%
97
  nrow() == 0)
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  chec_data_final = chec_data %>%
100
  left_join(
101
  genomicfeatures %>%
 
110
  select(regulator_locus_tag, regulator_symbol, target_locus_tag, target_symbol, peak_score) %>%
111
  arrange(regulator_locus_tag, target_locus_tag)
112
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  rnaseq_data_final = rnaseq_data %>%
114
  left_join(
115
  genomicfeatures %>%
 
124
  select(regulator_locus_tag, regulator_symbol, target_locus_tag, target_symbol, log2fc) %>%
125
  arrange(regulator_locus_tag, target_locus_tag)
126
 
127
+ sample_id_map = tibble(
128
+ regulator_locus_tag = union(rnaseq_data_final$regulator_locus_tag,
129
+ chec_data_final$regulator_locus_tag)) %>%
130
+ mutate(sample_id = row_number())
131
+
132
+
133
+ # chec_data_final %>%
134
+ # left_join(sample_id_map) %>%
135
+ # select(sample_id, all_of(colnames(chec_data_final))) %>%
136
+ # write_parquet(here("~/code/hf/mahendrawada_2025/chec_mahendrawada_2025.parquet"),
137
+ # compression = "zstd",
138
+ # write_statistics = TRUE,
139
+ # use_dictionary = c(
140
+ # sample_id = TRUE,
141
+ # regulator_locus_tag = TRUE,
142
+ # regulator_symbol = TRUE,
143
+ # target_locus_tag = TRUE,
144
+ # target_symbol = TRUE
145
+ # )
146
+ # )
147
+ #
148
+ # rnaseq_data_final %>%
149
+ # left_join(sample_id_map) %>%
150
+ # select(sample_id, all_of(colnames(rnaseq_data_final))) %>%
151
+ # write_parquet(here("~/code/hf/mahendrawada_2025/rnaseq_mahendrawada_2025.parquet"),
152
+ # compression = "zstd",
153
+ # write_statistics = TRUE,
154
+ # use_dictionary = c(
155
+ # sample_id = TRUE,
156
+ # regulator_locus_tag = TRUE,
157
+ # regulator_symbol = TRUE,
158
+ # target_locus_tag = TRUE,
159
+ # target_symbol = TRUE
160
+ # )
161
+ # )
162
+ #
163
+ # mahedrawada_genomicfeatures %>%
164
+ # left_join(genomicfeatures %>%
165
+ # select(locus_tag, symbol) %>%
166
+ # mutate(gene_id = locus_tag)) %>%
167
+ # write_parquet(here("~/code/hf/mahendrawada_2025/features_mahendrawada_2025.parquet"),
168
+ # compression = "zstd",
169
+ # write_statistics = TRUE,
170
+ # use_dictionary = c(
171
+ # gene_id = TRUE,
172
+ # gene_name = TRUE,
173
+ # chr = TRUE,
174
+ # locus_tag = TRUE,
175
+ # symbol = TRUE,
176
+ # coactivator = TRUE
177
+ # )
178
+ # )