Skip to content

Commit fe980d6

Browse files
committed
add make_pseudobulk
1 parent 9dace73 commit fe980d6

File tree

3 files changed

+341
-104
lines changed

3 files changed

+341
-104
lines changed

dev/download.R

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ library(HDF5Array)
1616
db <- db()
1717

1818
# Arguments
19-
args = commandArgs(trailingOnly=TRUE)
20-
root_directory = args[[1]]
19+
root_directory = "/vast/projects/cellxgene_curated/raw_data_Apr_2024"
2120

2221
files_metadata =
2322
datasets(db) |>
@@ -28,6 +27,30 @@ files_metadata =
2827

2928
files_metadata |> saveRDS(glue("{root_directory}/files_metadata.rds"))
3029

30+
31+
test =
32+
files_metadata |>
33+
slice(1:50) |>
34+
nest(data = c(dataset_id, dataset_version_id, filetype, url)) |>
35+
mutate(has_donor_id = map_lgl(
36+
data,
37+
~ {
38+
h5_path = .x |> files_download(dry.run = FALSE)
39+
has_donor_id =
40+
h5_path |>
41+
readH5AD(use_hdf5 = TRUE ) |>
42+
colData() |>
43+
as_tibble() |>
44+
select(any_of("donor_id")) |>
45+
ncol() >
46+
0
47+
file.remove(h5_path)
48+
has_donor_id
49+
}
50+
)) |>
51+
unnest(data) |>
52+
select(dataset_version_id, has_donor_id)
53+
3154
files_metadata |>
3255

3356
# Get organism list and filter human

dev/get_pseudobulk.R

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)