Skip to content

Commit

Permalink
Re-order consolidation processing to reduce memory use
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-Kent committed Oct 26, 2020
1 parent f454917 commit 61344b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/split_phenotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ consolidate_and_summarize_cell_seg_data = function(csd_files, output_dir,

# Read subsequent files, report, split phenotypes, join with the first file.
purrr::walk2(names[-1], csd_files[-1], function(name, path) {
csd2 = process_one_file(name, path) %>%
# We only need the phenotype columns and join columns from the previous file
# Drop everything else to free memory
csd = csd %>%
dplyr::select(!!rlang::sym(field_col), `Cell ID`,
dplyr::starts_with('Phenotype '))

csd2 = process_one_file(name, path)

if (nrow(csd2) != start_row_count)
stop('Number of rows in data frames do not match.\n',
nrow(csd2), ' != ', start_row_count, ' Failed at\n', path)
Expand Down

0 comments on commit 61344b9

Please sign in to comment.