Skip to content

Commit

Permalink
frame.insert --> pd.concat()
Browse files Browse the repository at this point in the history
  • Loading branch information
cfbuenabadn authored Aug 18, 2023
1 parent 0a30911 commit 97e8208
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion psix/mrna_census.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,21 @@ def tpm2mrna(tpm_file, cell_list, bw_method='scott', adjust_high = True, remove_
mrna_counts_per_cell = []
cells = tpm_dataset.columns
tpm_dataset_filtered = tpm_dataset.loc[tpm_dataset.max(axis=1) > 0.1]

kept_cells = []
mrna_counts_list = []

for cell in tqdm(cells, position=0, leave=True):
cell_mrna = transform_cell(tpm_dataset_filtered[cell], remove_outliers, bw_method, adjust_high)
if all([x == 0 for x in cell_mrna]):
continue
mrna_counts[cell] = cell_mrna

kept_cells.append(cell)
mrna_counts_list.append(cell_mrna)
#mrna_counts[cell] = cell_mrna

mrna_counts = pd.concat(mrna_counts_list)
mrna_counts.columns = kept_cells

return mrna_counts

Expand Down

0 comments on commit 97e8208

Please sign in to comment.