Skip to content

Commit

Permalink
add make_pseudobulk
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Apr 23, 2024
1 parent 9dace73 commit fe980d6
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 104 deletions.
27 changes: 25 additions & 2 deletions dev/download.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ library(HDF5Array)
db <- db()

# Arguments
args = commandArgs(trailingOnly=TRUE)
root_directory = args[[1]]
root_directory = "/vast/projects/cellxgene_curated/raw_data_Apr_2024"

files_metadata =
datasets(db) |>
Expand All @@ -28,6 +27,30 @@ files_metadata =

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


test =
files_metadata |>
slice(1:50) |>
nest(data = c(dataset_id, dataset_version_id, filetype, url)) |>
mutate(has_donor_id = map_lgl(
data,
~ {
h5_path = .x |> files_download(dry.run = FALSE)
has_donor_id =
h5_path |>
readH5AD(use_hdf5 = TRUE ) |>
colData() |>
as_tibble() |>
select(any_of("donor_id")) |>
ncol() >
0
file.remove(h5_path)
has_donor_id
}
)) |>
unnest(data) |>
select(dataset_version_id, has_donor_id)

files_metadata |>

# Get organism list and filter human
Expand Down
102 changes: 0 additions & 102 deletions dev/get_pseudobulk.R

This file was deleted.

Loading

0 comments on commit fe980d6

Please sign in to comment.