anndata

Annotated multivariate observation data in R

https://github.com/dynverse/anndata

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Annotated multivariate observation data in R

Basic Info
Statistics
  • Stars: 50
  • Watchers: 2
  • Forks: 4
  • Open Issues: 6
  • Releases: 3
Created almost 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing Funding License

README.Rmd

---
output:
  github_document:
    html_preview: false
bibliography: man/readme_files/references.bib
---

```{r setup1, include=FALSE}
library(tidyverse)
set.seed(1)
```

# anndata for R


[![CRAN](https://www.r-pkg.org/badges/version/anndata)](https://cran.r-project.org/package=anndata)
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/anndata)](https://cran.r-project.org/package=anndata)
[![R-CMD-check](https://github.com/dynverse/anndata/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dynverse/anndata/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://app.codecov.io/gh/dynverse/anndata/branch/main/graph/badge.svg)](https://app.codecov.io/gh/dynverse/anndata?branch=main)


[`anndata`](https://anndata.readthedocs.io/en/latest/) is a commonly used Python package 
for keeping track of data and learned annotations, and can be used to read from and write to the h5ad 
file format. It is also the main data format used in the scanpy python package [@wolf_scanpylargescalesinglecell_2018].

![](https://raw.githubusercontent.com/dynverse/anndata/master/man/readme_files/anndata_for_r.png)

However, using scanpy/anndata in R can be a major hassle. When trying to read an h5ad file,
R users could approach this problem in one of two ways. A) You could read in the file manually
(since it's an H5 file), but this involves a lot of manual work and a lot of understanding
on how the h5ad and H5 file formats work (also, expect major headaches from cryptic hdf5r bugs).
Or B) interact with scanpy and anndata through reticulate, but run into issues converting
some of the python objects into R.

We recently published [`anndata`](https://cran.r-project.org/package=anndata) on CRAN,
which is a reticulate wrapper for the Python package -- with some syntax sprinkled on top to make
R users feel more at home. 

anndata for R is still under active development at [github.com/dynverse/anndata](https://github.com/dynverse/anndata). 
If you encounter any issues, feel free to post an issue on GitHub!

## Installation

You can install `anndata` for R from CRAN as follows:

```r
install.packages("anndata")
```

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

If not, try running:

```r
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:

```{r}
library(anndata)

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

ad

Matrix::rowMeans(ad$X[1:10, ])
```


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:

```{r vignettes, results='asis', echo=FALSE}
walk(
  list.files("vignettes", pattern = "*.Rmd", recursive = TRUE),
  function(file) {
    title <-
      read_lines(paste0("vignettes/", file)) %>%
      keep(~ grepl("^title: ", .)) %>%
      gsub("title: \"(.*)\"", "\\1", .)
    vignette_name <- gsub("\\.Rmd", "", file)
    html_name <- gsub("\\.Rmd", ".html", file)

    cat("* [", title, "](https://anndata.dynverse.org/articles/", html_name, ")\n", sep = "")
  }
)
```

## Future work

In some cases, this package may still act more like a Python package rather than an R package.
Some more helper functions and helper classes need to be defined in order to fully encapsulate
`AnnData()` objects. Examples are `ad$chunked_X(...)`, backed file modes, `read_zarr()` and `ad$write_zarr()`.

## References

Owner

  • Name: dynverse: benchmarking, constructing and interpreting single-cell trajectories
  • Login: dynverse
  • Kind: organization
  • Location: The dynverse

The dynverse is an open set of packages to benchmark, construct and interpret single-cell trajectories. See https://dynverse.org for an overview

GitHub Events

Total
  • Issues event: 6
  • Watch event: 8
  • Delete event: 5
  • Issue comment event: 12
  • Push event: 22
  • Pull request review comment event: 1
  • Pull request event: 7
  • Pull request review event: 2
  • Create event: 4
Last Year
  • Issues event: 6
  • Watch event: 8
  • Delete event: 5
  • Issue comment event: 12
  • Push event: 22
  • Pull request review comment event: 1
  • Pull request event: 7
  • Pull request review event: 2
  • Create event: 4

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 135
  • Total Committers: 1
  • Avg Commits per committer: 135.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Robrecht Cannoodt r****d@g****m 135

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 28
  • Total pull requests: 8
  • Average time to close issues: 10 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 21
  • Total pull request authors: 2
  • Average comments per issue: 3.04
  • Average comments per pull request: 0.0
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • akhst7 (7)
  • pati-ni (2)
  • rcannood (1)
  • KaiWaldrant (1)
  • orenbenkiki (1)
  • LMayhew (1)
  • GreenGilad (1)
  • binyaminZ (1)
  • OmarSalem12 (1)
  • milanmlft (1)
  • zh-zhang1984 (1)
  • UboCA (1)
  • simonmfr (1)
  • schienstockd (1)
  • joonlee3 (1)
Pull Request Authors
  • rcannood (11)
  • MichaelChirico (2)
Top Labels
Issue Labels
enhancement (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 3,620 last-month
  • Total docker downloads: 1,623
  • Total dependent packages: 1
  • Total dependent repositories: 7
  • Total versions: 9
  • Total maintainers: 1
cran.r-project.org: anndata

'anndata' for R

  • Versions: 9
  • Dependent Packages: 1
  • Dependent Repositories: 7
  • Downloads: 3,620 Last month
  • Docker Downloads: 1,623
Rankings
Stargazers count: 9.0%
Downloads: 9.9%
Dependent repos count: 11.1%
Average: 13.9%
Forks count: 14.2%
Dependent packages count: 18.2%
Docker downloads count: 21.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • Matrix * imports
  • R6 * imports
  • assertthat * imports
  • methods * imports
  • reticulate >= 1.17 imports
  • knitr * suggests
  • rmarkdown * suggests
  • stats * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • actions/setup-python v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • actions/setup-python v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/setup-python v3 composite
  • actions/upload-artifact v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite