Skip to content

Commit 7565135

Browse files
authored
fixed filter_transcripts
Updated section retrieval logic and added debug prints.
1 parent e50ffbf commit 7565135

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/xenium_analysis_tools/alignment/format_for_napari.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,14 @@ def filter_transcripts(sdata,
123123
if return_only:
124124
tx_els = {}
125125
for tx_el in list(sdata.points.keys()):
126+
print(f'Filtering {tx_el}...')
126127
if not tx_el.startswith('transcripts'):
127128
continue
128129

129130
tx = sdata.points[tx_el]
130131

131132
if sections:
132-
tx_sec = np.unique(plot_sdata_fov['transcripts-3']['section'].compute())[0]
133+
tx_sec = np.unique(tx['section'].compute())[0]
133134
if tx_sec not in sections:
134135
print(f"Skipping {tx_el} (section {tx_sec} not in filter list)")
135136
continue
@@ -170,11 +171,12 @@ def filter_transcripts(sdata,
170171
tx_el = f"{add_prefix}_{tx_el}"
171172
if return_only:
172173
tx_els[tx_el] = tx
174+
else:
175+
sdata.points[tx_el] = tx
173176

174177
if return_only:
175178
return tx_els
176179
else:
177-
sdata.points[tx_el] = tx
178180
return sdata
179181

180182
def is_dask(df):

0 commit comments

Comments
 (0)