@@ -25,6 +25,8 @@ class CrossModalityTranslationMixinProtocol(AnalysisMixinProtocol[K, B]):
2525 def _cell_transition (self : AnalysisMixinProtocol [K , B ], * args : Any , ** kwargs : Any ) -> pd .DataFrame :
2626 ...
2727
28+ def _annotation_mapping (self : AnalysisMixinProtocol [K , B ], * args : Any , ** kwargs : Any ) -> pd .DataFrame :
29+ ...
2830
2931class CrossModalityTranslationMixin (AnalysisMixin [K , B ]):
3032 """Cross modality translation analysis mixin class."""
@@ -184,13 +186,13 @@ def cell_transition( # type: ignore[misc]
184186 key_added = key_added ,
185187 )
186188
187- def annotation_mapping (
189+ def annotation_mapping ( # type: ignore[misc]
188190 self : CrossModalityTranslationMixinProtocol [K , B ],
189191 mapping_mode : Literal ["sum" , "max" ],
190192 annotation_label : str ,
191193 forward : bool ,
192- source : K = "src" ,
193- target : K = "tgt" ,
194+ source : str = "src" ,
195+ target : str = "tgt" ,
194196 scale_by_marginals : bool = True ,
195197 other_adata : Optional [str ] = None ,
196198 cell_transition_kwargs : Mapping [str , Any ] = types .MappingProxyType ({}),
@@ -202,7 +204,7 @@ def annotation_mapping(
202204 target = target ,
203205 key = self .batch_key ,
204206 forward = forward ,
205- other_adata = self .adata_tgt ,
207+ other_adata = self .adata_tgt if other_adata is None else other_adata ,
206208 scale_by_marginals = scale_by_marginals ,
207209 cell_transition_kwargs = cell_transition_kwargs ,
208210 )
0 commit comments