From a4acdf778aa90427f2548923c68a0040f271aa25 Mon Sep 17 00:00:00 2001 From: Yenaled Date: Fri, 5 Jan 2024 06:53:37 -0800 Subject: [PATCH] cleanup anndata also clean up args.umi_gene legacy --- kb_python/count.py | 10 ---------- kb_python/main.py | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/kb_python/count.py b/kb_python/count.py index 3cdc449..bf5d328 100755 --- a/kb_python/count.py +++ b/kb_python/count.py @@ -2016,29 +2016,24 @@ def update_results_with_suffix(current_results, new_results, suffix): if sum_matrices and sum_matrices != 'none': # Sum up multiple matrices sums = {} - updated_prefixes = [] if sum_matrices == 'cell' or sum_matrices == 'total': sums['cell'] = do_sum_matrices( count_result[prefixes.index('processed')]['mtx'], count_result[prefixes.index('ambiguous')]['mtx'], f'{counts_prefix}.cell.mtx', em or mm ) - updated_prefixes = ['cell', 'unprocessed'] if sum_matrices == 'nucleus' or sum_matrices == 'total': sums['nucleus'] = do_sum_matrices( count_result[prefixes.index('unprocessed')]['mtx'], count_result[prefixes.index('ambiguous')]['mtx'], f'{counts_prefix}.nucleus.mtx', em or mm ) - updated_prefixes = ['processed', 'nucleus'] if sum_matrices == 'total': sums['total'] = do_sum_matrices( f'{counts_prefix}.mature.mtx', f'{counts_prefix}.nucleus.mtx', f'{counts_prefix}.total.mtx', em or mm ) - updated_prefixes = prefixes - prefixes = updated_prefixes for prefix, f in sums.items(): res = copy.deepcopy(count_result[0]) res['mtx'] = f @@ -2184,29 +2179,24 @@ def update_results_with_suffix(current_results, new_results, suffix): if sum_matrices and sum_matrices != 'none': # Sum up multiple matrices sums = {} - updated_prefixes = [] if sum_matrices == 'cell' or sum_matrices == 'total': sums['cell'] = do_sum_matrices( count_result[prefixes.index('processed')]['mtx'], count_result[prefixes.index('ambiguous')]['mtx'], f'{filtered_counts_prefix}.cell.mtx', em or mm ) - updated_prefixes = ['cell', 'unprocessed'] if sum_matrices == 'nucleus' or sum_matrices == 'total': sums['nucleus'] = do_sum_matrices( count_result[prefixes.index('unprocessed')]['mtx'], count_result[prefixes.index('ambiguous')]['mtx'], f'{filtered_counts_prefix}.nucleus.mtx', em or mm ) - updated_prefixes = ['processed', 'nucleus'] if sum_matrices == 'total': sums['total'] = do_sum_matrices( f'{filtered_counts_prefix}.mature.mtx', f'{filtered_counts_prefix}.nucleus.mtx', f'{filtered_counts_prefix}.total.mtx', em or mm ) - updated_prefixes = prefixes - prefixes = updated_prefixes for prefix, f in sums.items(): res = copy.deepcopy(count_result[0]) res['mtx'] = f diff --git a/kb_python/main.py b/kb_python/main.py index 9c7d776..683ef3f 100755 --- a/kb_python/main.py +++ b/kb_python/main.py @@ -689,7 +689,7 @@ def parse_count( fragment_s=args.fragment_s, paired=args.parity == 'paired', strand=args.strand, - umi_gene=args.umi_gene, + umi_gene=args.x.upper() not in ('BULK', 'SMARTSEQ2'), em=args.em, by_name=args.gene_names )