Skip to content

Commit 993ab58

Browse files
authored
Merge pull request #234 from pachterlab/devel
cleanup anndata
2 parents 9933bbc + a4acdf7 commit 993ab58

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

kb_python/count.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,29 +2016,24 @@ def update_results_with_suffix(current_results, new_results, suffix):
20162016
if sum_matrices and sum_matrices != 'none':
20172017
# Sum up multiple matrices
20182018
sums = {}
2019-
updated_prefixes = []
20202019
if sum_matrices == 'cell' or sum_matrices == 'total':
20212020
sums['cell'] = do_sum_matrices(
20222021
count_result[prefixes.index('processed')]['mtx'],
20232022
count_result[prefixes.index('ambiguous')]['mtx'],
20242023
f'{counts_prefix}.cell.mtx', em or mm
20252024
)
2026-
updated_prefixes = ['cell', 'unprocessed']
20272025
if sum_matrices == 'nucleus' or sum_matrices == 'total':
20282026
sums['nucleus'] = do_sum_matrices(
20292027
count_result[prefixes.index('unprocessed')]['mtx'],
20302028
count_result[prefixes.index('ambiguous')]['mtx'],
20312029
f'{counts_prefix}.nucleus.mtx', em or mm
20322030
)
2033-
updated_prefixes = ['processed', 'nucleus']
20342031
if sum_matrices == 'total':
20352032
sums['total'] = do_sum_matrices(
20362033
f'{counts_prefix}.mature.mtx',
20372034
f'{counts_prefix}.nucleus.mtx',
20382035
f'{counts_prefix}.total.mtx', em or mm
20392036
)
2040-
updated_prefixes = prefixes
2041-
prefixes = updated_prefixes
20422037
for prefix, f in sums.items():
20432038
res = copy.deepcopy(count_result[0])
20442039
res['mtx'] = f
@@ -2184,29 +2179,24 @@ def update_results_with_suffix(current_results, new_results, suffix):
21842179
if sum_matrices and sum_matrices != 'none':
21852180
# Sum up multiple matrices
21862181
sums = {}
2187-
updated_prefixes = []
21882182
if sum_matrices == 'cell' or sum_matrices == 'total':
21892183
sums['cell'] = do_sum_matrices(
21902184
count_result[prefixes.index('processed')]['mtx'],
21912185
count_result[prefixes.index('ambiguous')]['mtx'],
21922186
f'{filtered_counts_prefix}.cell.mtx', em or mm
21932187
)
2194-
updated_prefixes = ['cell', 'unprocessed']
21952188
if sum_matrices == 'nucleus' or sum_matrices == 'total':
21962189
sums['nucleus'] = do_sum_matrices(
21972190
count_result[prefixes.index('unprocessed')]['mtx'],
21982191
count_result[prefixes.index('ambiguous')]['mtx'],
21992192
f'{filtered_counts_prefix}.nucleus.mtx', em or mm
22002193
)
2201-
updated_prefixes = ['processed', 'nucleus']
22022194
if sum_matrices == 'total':
22032195
sums['total'] = do_sum_matrices(
22042196
f'{filtered_counts_prefix}.mature.mtx',
22052197
f'{filtered_counts_prefix}.nucleus.mtx',
22062198
f'{filtered_counts_prefix}.total.mtx', em or mm
22072199
)
2208-
updated_prefixes = prefixes
2209-
prefixes = updated_prefixes
22102200
for prefix, f in sums.items():
22112201
res = copy.deepcopy(count_result[0])
22122202
res['mtx'] = f

kb_python/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def parse_count(
689689
fragment_s=args.fragment_s,
690690
paired=args.parity == 'paired',
691691
strand=args.strand,
692-
umi_gene=args.umi_gene,
692+
umi_gene=args.x.upper() not in ('BULK', 'SMARTSEQ2'),
693693
em=args.em,
694694
by_name=args.gene_names
695695
)

0 commit comments

Comments
 (0)