cmatkhan commited on
Commit
ed1b6b1
·
verified ·
1 Parent(s): b7b6d05

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/parse_harbison_data.R +53 -28
scripts/parse_harbison_data.R CHANGED
@@ -130,34 +130,59 @@ combined_harbison_harmonized = combined_harbison %>%
130
  dplyr::rename(harbison_regulator=tf) %>%
131
  select(-description)
132
 
133
- combined_harbison_harmonized %>%
134
- select(condition, regulator_locus_tag, target_locus_tag, effect, pvalue) %>%
135
- group_by(condition, regulator_locus_tag) %>%
136
- write_dataset(path = here("data/harbison/hf/data"), format = "parquet")
137
 
138
- combined_harbison_harmonized %>%
139
- select(regulator_locus_tag,regulator_symbol,
140
- target_locus_tag, target_symbol,
141
- condition, effect, pvalue) %>%
142
- write_parquet("~/code/hf/harbison_2004/harbison_2004.parquet",
143
- compression = "zstd",
144
- write_statistics = TRUE,
145
- chunk_size = 6226,
146
- use_dictionary = c(
147
- condition = TRUE,
148
- regulator_locus_tag = TRUE,
149
- regulator_symbol = TRUE,
150
- target_locus_tag = TRUE,
151
- target_symbol = TRUE
152
- )
153
- )
154
-
155
- combined_harbison_harmonized %>%
156
- select(harbison_locus_tag, target_locus_tag) %>%
157
  distinct() %>%
158
- write_csv("~/code/hf/harbison_2004/scripts/harbison_locus_tag_to_target_locus_tag.csv")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
- combined_harbison_harmonized %>%
161
- select(harbison_regulator, regulator_locus_tag) %>%
162
- distinct() %>%
163
- write_csv("~/code/hf/harbison_2004/scripts/harbison_regulator_to_regulator_locus_tag.csv")
 
130
  dplyr::rename(harbison_regulator=tf) %>%
131
  select(-description)
132
 
133
+ harbison_db_meta <- read_csv("data/promotersetsig_db_20251127.csv",
134
+ col_types = cols(composite_binding = col_character()))
 
 
135
 
136
+ db_id_map = harbison_db_meta %>%
137
+ filter(source_name == "harbison_chip") %>%
138
+ select(id, regulator_locus_tag, condition) %>%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  distinct() %>%
140
+ dplyr::rename(db_id = id) %>%
141
+ bind_rows(
142
+ tibble(
143
+ regulator_locus_tag = c("YSC0017"),
144
+ db_id = 0,
145
+ condition = c('YPD')
146
+ ))
147
+
148
+ combined_harbison_harmonized_for_parquet = combined_harbison_harmonized %>%
149
+ select(regulator_locus_tag, regulator_symbol,
150
+ condition, target_locus_tag, target_symbol,
151
+ effect, pvalue) %>%
152
+ left_join(db_id_map) %>%
153
+ arrange(db_id) %>%
154
+ group_by(db_id) %>%
155
+ mutate(sample_id = cur_group_id()) %>%
156
+ ungroup() %>%
157
+ select(sample_id, db_id, regulator_locus_tag, regulator_symbol,
158
+ condition,
159
+ target_locus_tag, target_symbol,
160
+ effect, pvalue)
161
+
162
+
163
+ # combined_harbison_harmonized_for_parquet %>%
164
+ # write_parquet("~/code/hf/harbison_2004/harbison_2004.parquet",
165
+ # compression = "zstd",
166
+ # write_statistics = TRUE,
167
+ # chunk_size = 6226,
168
+ # use_dictionary = c(
169
+ # sample_id = TRUE,
170
+ # condition = TRUE,
171
+ # regulator_locus_tag = TRUE,
172
+ # regulator_symbol = TRUE,
173
+ # target_locus_tag = TRUE,
174
+ # target_symbol = TRUE
175
+ # )
176
+ # )
177
+ #
178
+ #
179
+ # combined_harbison_harmonized %>%
180
+ # select(harbison_locus_tag, target_locus_tag) %>%
181
+ # distinct() %>%
182
+ # write_csv("~/code/hf/harbison_2004/scripts/harbison_locus_tag_to_target_locus_tag.csv")
183
+ #
184
+ # combined_harbison_harmonized %>%
185
+ # select(harbison_regulator, regulator_locus_tag) %>%
186
+ # distinct() %>%
187
+ # write_csv("~/code/hf/harbison_2004/scripts/harbison_regulator_to_regulator_locus_tag.csv")
188