anndata2ri#
Converter between Python’s AnnData and R’s SingleCellExperiment.
|
⇄ |
|
|
⇄ |
|
|
⇄ |
|
|
⇄ |
|
|
⇄ |
|
|
⇄ |
|
|
⇄ |
|
- anndata2ri.converter = <rpy2.robjects.conversion.Converter object>#
-
Includes
rpy2.robjects.numpy2ri
,rpy2.robjects.pandas2ri
, andscipy2ri
.
- anndata2ri.set_ipython_converter(ipython=None, converter=None)#
Set the default converter for
rmagic
in IPython.- Parameters:
- ipython
InteractiveShell
|None
(default:None
) The IPython instance to set the converter for. If not specified, the current IPython instance is used.
- converter
conversion
|None
(default:None
) The converter to use. If not specified,
converter
is used.
- ipython
anndata2ri.scipy2ri#
Convert scipy.sparse
matrices between Python and R.
For a detailed comparison between the two languages’ sparse matrix environment, see issue #8.
Here’s an overview over the matching classes (note that dtype=float32
is also supported):
R |
Python |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- anndata2ri.scipy2ri.converter = <rpy2.robjects.conversion.Converter object>#
The
Converter
forscipy.sparse
.Includes
rpy2.robjects.numpy2ri
.
- anndata2ri.scipy2ri.supported_r_matrix_classes(types=frozenset({'d', 'l', 'n'}), storage=frozenset({'C', 'R', 'T', 'di'}))#
Get supported classes, possibly limiting data types or storage types.
- Parameters:
- types
Iterable
[Literal
['d'
,'l'
,'n'
]] |Literal
['d'
,'l'
,'n'
] (default:frozenset({'n', 'l', 'd'})
) Data type character(s) from
supported_r_matrix_types
- storage
Iterable
[Literal
['C'
,'R'
,'T'
,'di'
]] |Literal
['C'
,'R'
,'T'
,'di'
] (default:frozenset({'R', 'T', 'di', 'C'})
) Storage mode(s) from
supported_r_matrix_storage
- types
- Returns:
frozenset
[str
] – All supported classes with those characters
- anndata2ri.scipy2ri.supported_r_matrix_storage = frozenset({'C', 'R', 'T', 'di'})#
The Matrix storage types supported by this module; Column-sparse, Row-Sparse, Triplets, and DIagonal.
- anndata2ri.scipy2ri.supported_r_matrix_types = frozenset({'d', 'l', 'n'})#
The Matrix data types supported by this module; Double, Logical, and patterN.