cmatkhan commited on
Commit
a220dd5
·
verified ·
1 Parent(s): acb3acd

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/parse_barkai_checseq.R +69 -38
scripts/parse_barkai_checseq.R CHANGED
@@ -170,18 +170,11 @@ gse178430_parsed_meta = bind_cols(
170
  regulator_symbol = mnase_tagged_symbol) %>%
171
  select(accession, regulator_locus_tag, regulator_symbol, strainid,
172
  instrument, genotype, dbd_donor_symbol, ortholog_donor,
173
- paralog_deletion_symbol, paralog_resistance_cassette)
174
-
175
- gse178430_parsed_meta %>%
176
- write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE178430_metadata.parquet"),
177
- compression = "zstd",
178
- write_statistics = TRUE,
179
- use_dictionary = c(
180
- accession = TRUE,
181
- regulator_locus_tag = TRUE,
182
- regulator_symbol = TRUE
183
- )
184
- )
185
 
186
  gse209631_meta = read_csv("data/barkai_checseq/GSE209631/SraRunTable.csv")
187
 
@@ -192,37 +185,75 @@ gse209631_parsed_meta = gse209631_meta %>%
192
  arrange(tagged_tf, variant_type) %>%
193
  left_join(select(genomicfeatures, locus_tag, symbol) %>% dplyr::rename(tagged_tf = symbol)) %>%
194
  dplyr::rename(regulator_symbol = tagged_tf, regulator_locus_tag = locus_tag) %>%
195
- select(accession, regulator_locus_tag, regulator_symbol, variant_type)
196
-
197
- gse209631_parsed_meta %>%
198
- write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE209631_metadata.parquet"),
199
- compression = "zstd",
200
- write_statistics = TRUE,
201
- use_dictionary = c(
202
- accession = TRUE,
203
- regulator_locus_tag = TRUE,
204
- regulator_symbol = TRUE,
205
- variant_type = TRUE
206
- )
207
- )
208
 
209
- gse=GEOquery::getGEO(filename=here("data/barkai_checseq/GSE222268_series_matrix.txt"))
210
 
211
- gse222268_meta = Biobase::pData(gse@phenoData) %>% as_tibble() %>%
212
  select(title, geo_accession, extract_protocol_ch1, description,
213
  instrument_model, library_selection) %>%
214
  mutate(description = ifelse(description == "", library_selection, description)) %>%
215
  dplyr::rename(accession = geo_accession) %>%
216
  select(-library_selection, -instrument_model, -extract_protocol_ch1)
217
 
218
- gse222268_meta %>%
219
- write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE222268_metadata.parquet"),
220
- compression = "zstd",
221
- write_statistics = TRUE,
222
- use_dictionary = c(
223
- accession = TRUE
224
- )
225
- )
226
-
227
-
228
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  regulator_symbol = mnase_tagged_symbol) %>%
171
  select(accession, regulator_locus_tag, regulator_symbol, strainid,
172
  instrument, genotype, dbd_donor_symbol, ortholog_donor,
173
+ paralog_deletion_symbol, paralog_resistance_cassette) %>%
174
+ arrange(accession) %>%
175
+ mutate(series = "GSE178430") %>%
176
+ mutate(sample_id = row_number()) %>%
177
+ relocate(sample_id, series, accession)
 
 
 
 
 
 
 
178
 
179
  gse209631_meta = read_csv("data/barkai_checseq/GSE209631/SraRunTable.csv")
180
 
 
185
  arrange(tagged_tf, variant_type) %>%
186
  left_join(select(genomicfeatures, locus_tag, symbol) %>% dplyr::rename(tagged_tf = symbol)) %>%
187
  dplyr::rename(regulator_symbol = tagged_tf, regulator_locus_tag = locus_tag) %>%
188
+ select(accession, regulator_locus_tag, regulator_symbol, variant_type) %>%
189
+ arrange(accession) %>%
190
+ mutate(series = "GSE209631") %>%
191
+ mutate(sample_id = row_number()) %>%
192
+ relocate(sample_id, series, accession)
193
+
194
+
 
 
 
 
 
 
195
 
196
+ gse222268 = GEOquery::getGEO(filename=here("data/barkai_checseq/GSE222268_series_matrix.txt"))
197
 
198
+ gse222268_meta = Biobase::pData(gse222268@phenoData) %>% as_tibble() %>%
199
  select(title, geo_accession, extract_protocol_ch1, description,
200
  instrument_model, library_selection) %>%
201
  mutate(description = ifelse(description == "", library_selection, description)) %>%
202
  dplyr::rename(accession = geo_accession) %>%
203
  select(-library_selection, -instrument_model, -extract_protocol_ch1)
204
 
205
+ gse222268_parsed_meta <- gse222268_meta %>%
206
+ mutate(
207
+ regulator_symbol = str_extract(title, "^[^_]+"),
208
+ experiment_details = str_remove(title, "^[^_]+_")) %>%
209
+ mutate(regulator_symbol = toupper(regulator_symbol)) %>%
210
+ mutate(regulator_symbol = str_replace(regulator_symbol, "UGA3C", "UGA3")) %>%
211
+ mutate(regulator_symbol = ifelse(str_detect(regulator_symbol, "MNASE"),
212
+ "none", regulator_symbol)) %>%
213
+ left_join(
214
+ select(genomicfeatures, locus_tag, symbol) %>%
215
+ dplyr::rename(regulator_locus_tag = locus_tag,
216
+ regulator_symbol = symbol)) %>%
217
+ replace_na(list(regulator_locus_tag = "none")) %>%
218
+ select(-title) %>%
219
+ arrange(accession) %>%
220
+ mutate(series = "GSE222268") %>%
221
+ mutate(sample_id = row_number()) %>%
222
+ relocate(sample_id, series, accession)
223
+
224
+ # gse178430_parsed_meta %>%
225
+ # write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE178430_metadata.parquet"),
226
+ # compression = "zstd",
227
+ # write_statistics = TRUE,
228
+ # use_dictionary = c(
229
+ # sample_id = TRUE,
230
+ # accession = TRUE,
231
+ # regulator_locus_tag = TRUE,
232
+ # regulator_symbol = TRUE
233
+ # )
234
+ # )
235
+ #
236
+ # gse209631_parsed_meta %>%
237
+ # write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE209631_metadata.parquet"),
238
+ # compression = "zstd",
239
+ # write_statistics = TRUE,
240
+ # use_dictionary = c(
241
+ # sample_id = TRUE,
242
+ # accession = TRUE,
243
+ # regulator_locus_tag = TRUE,
244
+ # regulator_symbol = TRUE,
245
+ # variant_type = TRUE
246
+ # )
247
+ # )
248
+ #
249
+ # gse222268_parsed_meta %>%
250
+ # write_parquet(here("/home/chase/code/hf/barkai_compendium/GSE222268_metadata.parquet"),
251
+ # compression = "zstd",
252
+ # write_statistics = TRUE,
253
+ # use_dictionary = c(
254
+ # sample_id = TRUE,
255
+ # regulator_locus_tag = TRUE,
256
+ # regulator_symbol = TRUE,
257
+ # accession = TRUE
258
+ # )
259
+ # )