Fix bug with metadata when processing multiple .loom files

#3
by davidjwen - opened
Files changed (1) hide show
  1. geneformer/tokenizer.py +2 -1
geneformer/tokenizer.py CHANGED
@@ -108,7 +108,8 @@ class TranscriptomeTokenizer:
108
  loom_file_path
109
  )
110
  tokenized_cells += file_tokenized_cells
111
- cell_metadata.update(file_cell_metadata)
 
112
 
113
  return tokenized_cells, cell_metadata
114
 
 
108
  loom_file_path
109
  )
110
  tokenized_cells += file_tokenized_cells
111
+ for k in cell_metadata.keys():
112
+ cell_metadata[k] += file_cell_metadata[k]
113
 
114
  return tokenized_cells, cell_metadata
115