Skip to content

Commit bceec9e

Browse files
committed
remove threshold setting as it isn't relevant for tangram projection type used
1 parent e5e8e56 commit bceec9e

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

cholab-prep/example_xenium-multichannel-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ annotation:
8181
sc_reference_path: /sc/arion/projects/untreatedIBD/cache/reference-objects/oliver-2024-subset.h5ad # path to the annotated scRNAseq reference used by Tangram
8282
cell_type_key: level_2_annot # key of adata_ref.obs containing the cell-type annotation
8383
reference_preprocessing: log1p # if your reference `adata.X` contains raw counts, then remove this parameter from the config. Else, choose "log1p" (if you have already run both `sc.pp.normalize_total` and `sc.pp.log1p` on your reference) or "normalized" (if you have already run `sc.pp.normalize_total` on your reference)
84-
threshold: 0.5 # Add this parameter to control the threshold for cell type assignment
8584

8685
# [only if you choose the simple staining-based annotation (comment out the lines below)]
8786
# method: fluorescence

sopa/utils/annotation.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def tangram_annotate(
5959
reference_preprocessing: str | None = None,
6060
bag_size: int = 10_000,
6161
max_obs_reference: int = 10_000,
62-
threshold: float = 0.5,
6362
**kwargs,
6463
):
6564
"""Tangram multi-level annotation. Tangram is run on multiple bags of cells to decrease the RAM usage.
@@ -83,7 +82,6 @@ def tangram_annotate(
8382
reference_preprocessing,
8483
bag_size,
8584
max_obs_reference,
86-
threshold=threshold,
8785
**kwargs,
8886
).run()
8987

@@ -97,7 +95,6 @@ def __init__(
9795
reference_preprocessing: str | None,
9896
bag_size: int,
9997
max_obs_reference: int,
100-
threshold: float = 0.5,
10198
clip_percentile: float = 0.95,
10299
):
103100
self.ad_sp = ad_sp
@@ -112,7 +109,6 @@ def __init__(
112109
self.reference_preprocessing = reference_preprocessing
113110
self.bag_size = bag_size
114111
self.max_obs_reference = max_obs_reference
115-
self.threshold = threshold
116112
self.clip_percentile = clip_percentile
117113

118114
assert (
@@ -284,9 +280,7 @@ def run_group(self, level: int = 0, indices_sp=None, indices_sc=None):
284280
device=self.device,
285281
)
286282

287-
tg.project_cell_annotations(
288-
ad_map, ad_sp_split, annotation=self.level_obs_key(level), threshold=self.threshold
289-
)
283+
tg.project_cell_annotations(ad_map, ad_sp_split, annotation=self.level_obs_key(level))
290284

291285
res = ad_sp_split.obsm["tangram_ct_pred"]
292286
self.ad_sp.obsm[self.probs_key(level)].loc[split, res.columns] = res

0 commit comments

Comments
 (0)