moscot.utils.tagged_array.DistributionContainer.from_adata¶
- classmethod DistributionContainer.from_adata(adata, a, b, xy_attr=None, xy_key=None, xy_cost='sq_euclidean', xx_attr=None, xx_key=None, xx_cost='sq_euclidean', conditions_attr=None, conditions_key=None, backend='ott', **kwargs)[source]¶
Create distribution container from
AnnData
.Warning
Sparse arrays will be always densified.
- Parameters:
adata (
AnnData
) – Annotated data object.a (
Union
[ndarray
[Any
,dtype
[floating
]],Array
]) – Marginals when used as source distribution.b (
Union
[ndarray
[Any
,dtype
[floating
]],Array
]) – Marginals when used as target distribution.xy_attr (
Optional
[Literal
['X'
,'obsp'
,'obsm'
,'layers'
,'uns'
]]) – Attribute of adata containing the data for the shared space.xy_key (
Optional
[str
]) – Key of xy_attr containing the data for the shared space.xy_cost (
Union
[str
,Literal
['barcode_distance'
,'leaf_distance'
,'custom'
],Literal
['euclidean'
,'sq_euclidean'
,'cosine'
,'pnorm_p'
,'sq_pnorm'
,'geodesic'
]]) – Cost function when in the shared space.xx_attr (
Optional
[Literal
['X'
,'obsp'
,'obsm'
,'layers'
,'uns'
]]) – Attribute of adata containing the data for the incomparable space.xx_key (
Optional
[str
]) – Key of xx_attr containing the data for the incomparable space.xx_cost (
Union
[str
,Literal
['barcode_distance'
,'leaf_distance'
,'custom'
],Literal
['euclidean'
,'sq_euclidean'
,'cosine'
,'pnorm_p'
,'sq_pnorm'
,'geodesic'
]]) – Cost function in the incomparable space.conditions_attr (
Optional
[Literal
['obs'
,'var'
,'obsm'
,'varm'
,'layers'
,'uns'
]]) – Attribute of adata containing the conditions.conditions_key (
Optional
[str
]) – Key of conditions_attr containing the conditions.backend (
Literal
['ott'
]) – Backend to use.kwargs (
Any
) – Keyword arguments to pass to the cost functions.
- Return type:
- Returns:
: The distribution container.