Skip to main content

No project description provided

Project description

PyPI Version Bioconda Version Documentation Status Unit Tests Publication DOI

AnnData ↭ SingleCellExperiment

RPy2 converter from AnnData to SingleCellExperiment and back. (For details about conversion see the docs)

You can for example use it to process your data using both Scanpy and Seurat, as described in this example notebook

Installation

pip install anndata2ri
# or
conda install -c bioconda anndata2ri

Troubleshooting

If you have problems installing or importing anndata2ri, please make sure you first:

  1. Check the stack trace: If the error happens while installing or importing a dependency such as rpy2, report your problem in that project’s bug tracker.

  2. Search the issues. At the time of writing 17 of the 29 bugs (60%) are invalid or rpy2 bugs / install problems.

  3. Make sure you have a compatible R version: rpy2 requires R ≥ 3.6.

Usage from Python

Either use the converter manually …

import anndata2ri
from rpy2.robjects import r
from rpy2.robjects.conversion import localconverter

with localconverter(anndata2ri.converter):
    adata = r('as(some_data, "SingleCellExperiment")')

… or activate it globally:

import anndata2ri
from rpy2.robjects import r
anndata2ri.activate()

adata = r('as(some_data, "SingleCellExperiment")')

Usage from Jupyter

Activate the conversion before you load the extension:

import anndata2ri
anndata2ri.activate()
%load_ext rpy2.ipython

Now you can move objects from Python to R …

import scanpy.datasets as scd
adata_paul = scd.paul15()
%%R -i adata_paul
adata_paul  # class: SingleCellExperiment ...

… and back:

%%R -o adata_allen
data(allen, package = 'scRNAseq')
adata_allen <- as(allen, 'SingleCellExperiment')
print(adata_allen)  # AnnData object with ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anndata2ri-1.3.1.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

anndata2ri-1.3.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file anndata2ri-1.3.1.tar.gz.

File metadata

  • Download URL: anndata2ri-1.3.1.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for anndata2ri-1.3.1.tar.gz
Algorithm Hash digest
SHA256 0e3fa2f81789f682d19ef452fabdb401ec27899db9abe5a78e45e21dcc7caa42
MD5 9f0965c0e40bbea5711ea5fb2920ee46
BLAKE2b-256 fc48575235009fd5ea1021b7f77f285aa9b060c3c2a14a9b1316010eb7eb2632

See more details on using hashes here.

File details

Details for the file anndata2ri-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: anndata2ri-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for anndata2ri-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16409a82ccc8c9498afad84b59a966c21a647a6969de1c8cf707e0d90c8b9d19
MD5 38566ca70536bbc3cbb3f38fdb28cf79
BLAKE2b-256 d5d5cf4e2362f106653fa67866f365796d50457e9a61e087887a06fa49dfea7a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page