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

Use the converter as a context manager:

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

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

Usage from Jupyter

Override the R magic option:

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

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-2.0.1.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anndata2ri-2.0.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anndata2ri-2.0.1.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anndata2ri-2.0.1.tar.gz
Algorithm Hash digest
SHA256 449a245d0855bdcedd87225f24ae8693153f49b683dc7f66fa64a05210054f9c
MD5 ea8a6edd8e576754b19a2822c0ce2fc5
BLAKE2b-256 2dcadaaeac0e5fed04c019d308ced5ffc56076a2c93875a6a737db7ddb6d218d

See more details on using hashes here.

Provenance

The following attestation bundles were made for anndata2ri-2.0.1.tar.gz:

Publisher: deploy.yml on theislab/anndata2ri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: anndata2ri-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anndata2ri-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af447e3aae2ac3ea495888ce08498fc988e9e2dc7f16e5880080e15dcd7598f6
MD5 63ff38a44062896fe2c57286e1b19023
BLAKE2b-256 0137bba391a8a285ff7bdfc96314f4ca5e09c12f183384e30823a774e15c0144

See more details on using hashes here.

Provenance

The following attestation bundles were made for anndata2ri-2.0.1-py3-none-any.whl:

Publisher: deploy.yml on theislab/anndata2ri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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