目录

anndata for R

CRAN CRAN
Downloads R-CMD-check Codecov test
coverage Lifecycle:
superseded

⚠️ This package is superseded by anndataR.

anndataR provides a pure R implementation of the AnnData data structure with no Python required. It reads and writes .h5ad files natively and supports conversion to/from SingleCellExperiment and Seurat objects. New users should install anndataR from Bioconductor instead:

BiocManager::install("anndataR")

Existing users of anndata can follow the migration guide for guidance on switching to anndataR.

anndata for R is a reticulate wrapper for the Python anndata package.

Installation

Note: New projects should use anndataR instead. See the migration guide.

You can install anndata for R from CRAN as follows:

install.packages("anndata")

Normally, reticulate should take care of installing Miniconda and the Python anndata.

If not, try running:

reticulate::install_miniconda()
anndata::install_anndata()

Getting started

The API of anndata for R is very similar to its Python counterpart. Here is an example:

library(anndata)

ad <- read_h5ad("example_formats/pbmc_1k_protein_v3_processed.h5ad")

ad
## AnnData object with n_obs × n_vars = 713 × 33538
##     var: 'gene_ids', 'feature_types', 'genome', 'highly_variable', 'means', 'dispersions', 'dispersions_norm'
##     uns: 'hvgParameters', 'normalizationParameters', 'pca', 'pcaParameters'
##     obsm: 'X_pca'
##     varm: 'PCs'
Matrix::rowMeans(ad$X[1:10, ])
## AAACCCAAGTGGTCAG-1 AAAGGTATCAACTACG-1 AAAGTCCAGCGTGTCC-1 AACACACTCAAGAGTA-1 
##         0.06499579         0.06385104         0.06102355         0.06739055 
## AACACACTCGACGAGA-1 AACAGGGCAGGAGGTT-1 AACAGGGCAGTGTATC-1 AACAGGGTCAGAATAG-1 
##         0.08891241         0.08648681         0.09318970         0.09140243 
## AACCTGAAGATGGTCG-1 AACGGGATCGTTATCT-1 
##         0.06664118         0.07866523

See ?anndata for a full list of the functions provided by this package. Check out any of the other vignettes by clicking any of the links below:

Future work

This package is no longer under active development as it has been superseded by anndataR. Bug fixes may still be applied, but no new features are planned.

References

关于

用于在R语言中读写和处理单细胞组学数据AnnData格式的接口包

10.8 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号