moscot.problems.space.MappingProblem.correlate¶
- MappingProblem.correlate(var_names=None, corr_method='pearson', device=None, groupby=None, batch_size=None)¶
Correlate true and predicted gene expression.
Warning
Sparse matrices stored in
X
will be densified.- Parameters:
var_names (
Optional
[Sequence
[str
]]) – Keys invar_names
. IfNone
, use all shared genes.corr_method (
Literal
['pearson'
,'spearman'
]) –Correlation method. Valid options are:
'pearson'
- Pearson correlation.'spearman'
- Spearman rank correlation.
device (
Union
[Literal
['cpu'
,'gpu'
,'tpu'
],str
,None
]) – Device where to transfer the solutions, seeto()
.groupby (
Optional
[str
]) – Optional key inobs
, containing categorical annotations for grouping.batch_size (
Optional
[int
]) – Number of features to process at once. IfNone
, process all features at once. Larger values will require more memory.self (SpatialMappingMixinProtocol[K, B])
- Return type:
Union
[Mapping
[Tuple
[TypeVar
(K
, bound=Hashable
),TypeVar
(K
, bound=Hashable
)],Mapping
[Any
,Series
]],Mapping
[Tuple
[TypeVar
(K
, bound=Hashable
),TypeVar
(K
, bound=Hashable
)],Series
]]- Returns:
: Correlation for each solution in solutions.