Skip to content

Commit 7e19af2

Browse files
committed
more styling
1 parent 8b748d0 commit 7e19af2

3 files changed

Lines changed: 26 additions & 14 deletions

File tree

kb_python/count.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,9 @@ def update_results_with_suffix(current_results, new_results, suffix):
17801780
if f'bus{suffix}' in unfiltered_results:
17811781
bus_files_to_delete.append(unfiltered_results[f'bus{suffix}'])
17821782
if f'bus_scs{suffix}' in unfiltered_results:
1783-
bus_files_to_delete.append(unfiltered_results[f'bus_scs{suffix}'])
1783+
bus_files_to_delete.append(
1784+
unfiltered_results[f'bus_scs{suffix}']
1785+
)
17841786

17851787
# Delete filtered bus if exists
17861788
if 'filtered' in results and 'bus_scs' in results['filtered']:
@@ -2189,9 +2191,13 @@ def update_results_with_suffix(current_results, new_results, suffix):
21892191
elif i == 1: # unprocessed/unspliced
21902192
cr_dir = os.path.join(counts_dir, 'unspliced')
21912193
else: # ambiguous
2192-
cr_dir = os.path.join(counts_dir, f'{CELLRANGER_DIR}_{prefix}{suffix}')
2194+
cr_dir = os.path.join(
2195+
counts_dir, f'{CELLRANGER_DIR}_{prefix}{suffix}'
2196+
)
21932197
else:
2194-
cr_dir = os.path.join(counts_dir, f'{CELLRANGER_DIR}_{prefix}{suffix}')
2198+
cr_dir = os.path.join(
2199+
counts_dir, f'{CELLRANGER_DIR}_{prefix}{suffix}'
2200+
)
21952201

21962202
cr_result = matrix_to_cellranger(
21972203
count_result[i]['mtx'],
@@ -2235,7 +2241,10 @@ def update_results_with_suffix(current_results, new_results, suffix):
22352241
update_results_with_suffix(prefix_results, res, suffix)
22362242
if cellranger:
22372243
cr_result = matrix_to_cellranger(
2238-
res['mtx'], res['barcodes'], res['genes'], t2g_path,
2244+
res['mtx'],
2245+
res['barcodes'],
2246+
res['genes'],
2247+
t2g_path,
22392248
os.path.join(
22402249
counts_dir, f'{CELLRANGER_DIR}_{prefix}{suffix}'
22412250
),
@@ -2376,13 +2385,14 @@ def update_results_with_suffix(current_results, new_results, suffix):
23762385
)
23772386
else:
23782387
cr_dir = os.path.join(
2379-
filtered_counts_dir,
2380-
f'{CELLRANGER_DIR}_{prefix}'
2388+
filtered_counts_dir, f'{CELLRANGER_DIR}_{prefix}'
23812389
)
23822390

23832391
cr_result = matrix_to_cellranger(
2384-
count_result[i]['mtx'], count_result[i]['barcodes'],
2385-
count_result[i]['genes'], t2g_path,
2392+
count_result[i]['mtx'],
2393+
count_result[i]['barcodes'],
2394+
count_result[i]['genes'],
2395+
t2g_path,
23862396
cr_dir,
23872397
gzip=gzip
23882398
)
@@ -2871,10 +2881,8 @@ def count_velocity(
28712881
if cellranger:
28722882
if not tcc:
28732883
cr_result = matrix_to_cellranger(
2874-
count_result['mtx'],
2875-
count_result['barcodes'],
2876-
count_result['genes'],
2877-
t2g_path,
2884+
count_result['mtx'], count_result['barcodes'],
2885+
count_result['genes'], t2g_path,
28782886
os.path.join(
28792887
filtered_counts_dir,
28802888
f'{CELLRANGER_DIR}_{prefix}'

kb_python/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,11 @@ def do_sum_matrices(
872872
"Summing up two matrix files failed: Assertion failed"
873873
)
874874

875-
if to_write and to_write[0] == nums[0] and to_write[1] == nums[1]:
875+
if (
876+
to_write
877+
and to_write[0] == nums[0]
878+
and to_write[1] == nums[1]
879+
):
876880
to_write[2] += nums[2]
877881
else:
878882
if to_write:

tests/test_count.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ def test_count_kite_filter(self):
22542254
counts_prefix=os.path.join(
22552255
out_dir, FILTERED_COUNTS_DIR, FEATURE_PREFIX
22562256
),
2257-
kite=False,
2257+
kite=True,
22582258
tcc=False,
22592259
temp_dir=temp_dir,
22602260
threads=threads,

0 commit comments

Comments
 (0)