{"id":15043325,"url":"https://github.com/theislab/anndata2ri","last_synced_at":"2025-05-16T05:04:59.129Z","repository":{"id":38455524,"uuid":"171714778","full_name":"theislab/anndata2ri","owner":"theislab","description":"Convert between AnnData and SingleCellExperiment","archived":false,"fork":false,"pushed_at":"2025-05-13T08:19:02.000Z","size":247,"stargazers_count":132,"open_issues_count":15,"forks_count":19,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-13T09:25:10.011Z","etag":null,"topics":["bioconductor","jupyter","rpy2","scanpy","single-cell"],"latest_commit_sha":null,"homepage":"https://icb-anndata2ri.readthedocs-hosted.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theislab.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-20T17:03:16.000Z","updated_at":"2025-05-13T08:19:04.000Z","dependencies_parsed_at":"2023-02-19T16:00:40.288Z","dependency_job_id":"aa16783e-129b-4646-84d0-51c05865f40b","html_url":"https://github.com/theislab/anndata2ri","commit_stats":{"total_commits":192,"total_committers":6,"mean_commits":32.0,"dds":"0.36979166666666663","last_synced_commit":"3258fe378ff0fba30e25ab66744eb04e7c2b82e5"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fanndata2ri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fanndata2ri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fanndata2ri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theislab%2Fanndata2ri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theislab","download_url":"https://codeload.github.com/theislab/anndata2ri/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471060,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioconductor","jupyter","rpy2","scanpy","single-cell"],"created_at":"2024-09-24T20:48:51.698Z","updated_at":"2025-05-16T05:04:59.103Z","avatar_url":"https://github.com/theislab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|pypi| |conda| |rtd| |tests| |doi|\n\n.. |pypi| image:: https://img.shields.io/pypi/v/anndata2ri\n   :target: https://pypi.org/project/anndata2ri/\n   :alt: PyPI Version\n\n.. |conda| image:: https://img.shields.io/conda/vn/bioconda/anndata2ri\n   :target: https://anaconda.org/bioconda/anndata2ri\n   :alt: Bioconda Version\n\n.. |rtd| image:: https://readthedocs.com/projects/icb-anndata2ri/badge/?version=latest\u0026token=ee358f7efe36cbbd7d04db1b708fa81cefc44634ae7f3f8e0afcd03a1f0b1158\n   :target: docs_\n   :alt: Documentation Status\n\n.. |tests| image:: https://github.com/theislab/anndata2ri/actions/workflows/run_tests.yml/badge.svg\n   :target: https://github.com/theislab/anndata2ri/actions/workflows/run_tests.yml\n   :alt: Unit Tests\n\n.. |doi| image:: https://zenodo.org/badge/171714778.svg\n   :target: https://zenodo.org/badge/latestdoi/171714778\n   :alt: Publication DOI\n\nAnnData ↭ SingleCellExperiment\n==============================\n\nRPy2 converter from AnnData_ to SingleCellExperiment_ and back. (For **details about conversion** see the docs_)\n\nYou can for example use it to process your data using both Scanpy_ and Seurat_, as described in this `example notebook`_\n\n.. _AnnData: https://anndata.readthedocs.io/en/latest/\n.. _SingleCellExperiment: http://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html\n.. _docs: https://icb-anndata2ri.readthedocs-hosted.com/en/latest/\n.. _Scanpy: https://scanpy.readthedocs.io/en/stable/\n.. _Seurat: https://satijalab.org/seurat/\n.. _`example notebook`: https://github.com/LuckyMD/Code_snippets/blob/master/Seurat_to_anndata.ipynb\n\nInstallation\n------------\n\n.. code-block:: bash\n\n   pip install anndata2ri\n   # or\n   conda install -c bioconda anndata2ri\n\nTroubleshooting\n---------------\n\nIf you have problems installing or importing anndata2ri,\nplease make sure you first:\n\n1. Check the stack trace:\n   If the error happens while installing or importing a dependency such as rpy2_,\n   report your problem in that project’s bug tracker.\n2. Search the issues_.\n   At the time of writing 17 of the 29 bugs (60%) are invalid or rpy2 bugs / install problems.\n3. Make sure you have a compatible R version: rpy2 requires R ≥ 3.6.\n\n.. _rpy2: https://github.com/rpy2/rpy2#readme\n.. _issues: https://github.com/theislab/anndata2ri/issues\n\nUsage from Python\n-----------------\n\nEither use the converter manually …\n\n.. code-block:: python\n\n   import anndata2ri\n   from rpy2.robjects import r\n   from rpy2.robjects.conversion import localconverter\n\n   with localconverter(anndata2ri.converter):\n       adata = r('as(some_data, \"SingleCellExperiment\")')\n\n… or activate it globally:\n\n.. code-block:: python\n\n   import anndata2ri\n   from rpy2.robjects import r\n   anndata2ri.activate()\n\n   adata = r('as(some_data, \"SingleCellExperiment\")')\n\nUsage from Jupyter\n------------------\nActivate the conversion before you load the extension:\n\n.. code-block:: python\n\n   import anndata2ri\n   anndata2ri.activate()\n   %load_ext rpy2.ipython\n\nNow you can move objects from Python to R …\n\n.. code-block:: python\n\n   import scanpy.datasets as scd\n   adata_paul = scd.paul15()\n\n.. code-block:: r\n\n   %%R -i adata_paul\n   adata_paul  # class: SingleCellExperiment ...\n\n… and back:\n\n.. code-block:: r\n\n   %%R -o adata_allen\n   data(allen, package = 'scRNAseq')\n   adata_allen \u003c- as(allen, 'SingleCellExperiment')\n\n.. code-block:: python\n\n   print(adata_allen)  # AnnData object with ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fanndata2ri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheislab%2Fanndata2ri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheislab%2Fanndata2ri/lists"}