Skip to content

Commit 084a187

Browse files
authored
Prepare 0.2.0 release (#308)
1 parent ee7f29c commit 084a187

File tree

9 files changed

+146
-119
lines changed

9 files changed

+146
-119
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: anndataR
22
Title: AnnData interoperability in R
3-
Version: 0.1.0.9011
3+
Version: 0.2.0
44
Authors@R: c(
55
person("Robrecht", "Cannoodt", , "robrecht@data-intuitive.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood")),
@@ -48,7 +48,7 @@ Suggests:
4848
knitr,
4949
processx,
5050
reticulate (>= 1.41.1),
51-
rhdf5,
51+
rhdf5 (>= 2.52.1),
5252
rmarkdown,
5353
S4Vectors,
5454
Seurat,

NEWS.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,56 @@
1-
# anndataR devel
1+
# anndataR 0.2.0
22

3-
## anndataR 0.1.0.9011
3+
## Breaking changes
44

5-
- Updates for compatibility with Python **anndata** >= 0.12.0 (PR #305, Fixes #304)
5+
- Switch the HDF5 back end to use the **{rhdf5}** package instead of **{hdf5r}**
6+
(PR #283, Fixes #272, #175, #299)
7+
- This addresses various issues related to H5AD files and allows better
8+
integration with Bioconductor. Most of the previous known issues have now
9+
been resolved.
10+
- It also greatly improves compatibility with H5AD files written by Python
11+
**anndata**
12+
- **NOTE:** Make sure to install **{rhdf5}** instead of **{hdf5r}** to be able
13+
to read and write H5AD files!
14+
15+
## Major changes
16+
17+
- Updates for compatibility with Python **anndata** >= 0.12.0 (PR #305,
18+
Fixes #304)
619
- Add helpers for reading/writing `NULL` values to/from H5AD files
720
- Writing of `NULL` values can be disabled by setting
821
`option(anndataR.write_null = FALSE)` to allow the files to be read by
922
Python **anndata** < 0.12.0
10-
- Fix a bug where string arrays were not transposed correctly when writing to
11-
H5AD files (PR #305)
12-
- Fix a bug where the dimenions of dense arrays were not properly conserved
13-
when reading from H5AD (PR #305)
14-
- Remove workarounds and skipping of `none` values in roundtrip tests (PR #305)
15-
16-
## anndataR 0.1.0.9010
17-
18-
- Switch HDF5 back end from **{hdf5r}** to **{rhdf5}** (PR #283, Fixes #272, #175, #299)
19-
- Includes improved compatibility with H5AD files written by Python **anndata**
20-
- Improvements to roundtrip testing (PR #283)
21-
22-
## anndataR 0.1.0.9009
23-
24-
- Fix execution of roundtrip tests (PR #293)
25-
26-
## anndataR 0.1.0.9008
27-
28-
- Add Bioconductor installation instructions in preparation of submission (PR #297)
29-
30-
## anndataR 0.1.0.9007
31-
23+
- A `counts` or `data` layer is no longer required during `Seurat` conversion
24+
(PR #284)
25+
- There will still be a warning if neither of this is present as it may
26+
affect compatibility with **{Seurat}** functions
27+
28+
## Minor changes
29+
30+
- Use accessor functions/methods instead of direct slot access where possible
31+
(PR #291)
3232
- Refactor superfluous for loops (PR #298)
33-
-
34-
## anndataR 0.1.0.9006
35-
33+
- Change uses of `sapply()` to `vapply()` (PR #294)
3634
- Ignore `development_status.Rmd` vignette when building package (PR #296)
35+
- Remove `anndataR.Rproj` file from repository (PR #292)
3736

38-
## anndataR 0.1.0.9005
39-
40-
- Bypass requiring a `counts` or `data` layer during `Seurat` conversion (PR #284)
41-
42-
## anndataR 0.1.0.9004
37+
## Bug fixes
4338

44-
- Use accessors instead of direct slot access where possible (PR #291)
39+
- Fix a bug where string arrays were not transposed correctly when writing to
40+
H5AD files (PR #305)
41+
- Fix a bug where the dimensions of dense arrays were not properly conserved
42+
when reading from H5AD (PR #305)
4543

46-
## anndataR 0.1.0.9003
44+
## Documentation
4745

4846
- Simplify and update vignettes (PR #282)
47+
- Add Bioconductor installation instructions in preparation for submission (PR #297)
4948

50-
## anndataR 0.1.0.9002
51-
52-
- Remove `anndataR.Rproj` file from repository (PR #292)
53-
54-
## anndataR 0.1.0.9001
49+
## Testing
5550

56-
- Change uses of `sapply()` to `vapply()` (PR #294)
51+
- Improvements to round trip testing (PR #283, PR #293, PR #305)
52+
- Most round trip tests are now enabled and pass successfully
53+
- Conversion helpers have been added to assist with **{reticulate}** tests
5754

5855
# anndataR 0.1.0 (inital release candidate)
5956

R/write_h5ad.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@
1717
#' @param ... Additional arguments passed to [as_AnnData()]
1818
#'
1919
#' @details
20+
#'
21+
#' ## Compression
22+
#'
2023
#' Compression is currently not supported for Boolean arrays, they will be
2124
#' written uncompressed.
2225
#'
26+
#' ## `NULL` values
27+
#'
28+
#' For compatibility with changes in Python **anndata** 0.12.0, `NULL` values
29+
#' in `uns` are written to H5AD files as a `NULL` dataset (instead of not being
30+
#' written at all). To disable this behaviour, set
31+
#' `option(anndataR.write_null = FALSE)`. This may be required to allow the file
32+
#' to be read by older versions of Python **anndata**.
33+
#'
2334
#' @return `path` invisibly
2435
#' @export
2536
#'

README.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
# {anndataR}: An R package for working with AnnData objects <img src="man/figures/logo.png" align="right" alt="anndataR logo" width=120 />
22
<!-- badges: start -->
33
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
4-
[![CRAN status](https://www.r-pkg.org/badges/version/anndataR.png)](https://CRAN.R-project.org/package=anndataR)
54
[![R-CMD-check](https://github.com/scverse/anndataR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/scverse/anndataR/actions/workflows/R-CMD-check.yaml)
65
<!-- badges: end -->
76

8-
**{anndataR}** aims to make the AnnData format a first-class citizen in
9-
the R ecosystem, and to make it easy to work with AnnData files in R,
10-
either directly or by converting them to a SingleCellExperiment or Seurat
11-
object.
7+
**{anndataR}** aims to make the `AnnData` format a first-class citizen in the R ecosystem, and to make it easy to work with AnnData files in R, either directly or by converting them to a `SingleCellExperiment` or `Seurat` object.
128

139
**{anndataR}** is an scverse® community project maintained by [Data Intuitive](https://data-intuitive.com/), and is fiscally sponsored by the [Chan Zuckerberg Initiative](https://chanzuckerberg.com/).
1410

15-
1611
## Features of {anndataR}
1712

18-
- Provide an `R6` class to work with AnnData objects in R (either in-memory or on-disk).
13+
- Provide an `R6` class to work with `AnnData` objects in R (either in-memory or on-disk)
1914
- Read/write `*.h5ad` files natively
2015
- Convert to/from `SingleCellExperiment` objects
2116
- Convert to/from `Seurat` objects
2217

23-
> [!WARNING]
24-
>
25-
> This package is still in the experimental stage, and may not work as
26-
> expected. You can find the status of development of anndataR on the
27-
> [feature tracking page](https://anndatar.data-intuitive.com/articles/design.html#feature-tracking)
28-
> of the website. Please [report](https://github.com/scverse/anndataR/issues) any issues you encounter.
18+
You can find the status of development of **{anndataR}** on the [feature tracking page](https://anndatar.data-intuitive.com/articles/design.html#feature-tracking) of the package website.
19+
Please [report](https://github.com/scverse/anndataR/issues) any issues you encounter.
2920

3021
## Installation
3122

@@ -74,17 +65,13 @@ pak::pak("scverse/anndataR")
7465

7566
Take note that you need all suggested dependencies available, and that building them can take some time.
7667

77-
- **Getting started**: An introduction to the package and its features.
68+
- [**Getting started**](https://anndatar.data-intuitive.com/articles/anndataR.html): An introduction to the package and its features.
7869
`vignette("anndataR", package = "anndataR")`
79-
- **Reading and writing H5AD files**: How to read and write `*.h5ad` files.
80-
`vignette("usage_h5ad", package = "anndataR")`
81-
- **Converting to/from Seurat objects**: How to convert between `AnnData` and `Seurat` objects.
70+
- [**Read/write `Seurat` objects**](https://anndatar.data-intuitive.com/articles/usage_seurat.html): How to convert between `AnnData` and `Seurat` objects.
8271
`vignette("usage_seurat", package = "anndataR")`
83-
- **Converting to/from SingleCellExperiment objects**: How to convert between `AnnData` and `SingleCellExperiment` objects.
72+
- [**Read/write `SingleCellExperiment` objects**](https://anndatar.data-intuitive.com/articles/usage_singlecellexperiment.html): How to convert between `AnnData` and `SingleCellExperiment` objects
8473
`vignette("usage_singlecellexperiment", package = "anndataR")`
85-
- **Software Design**: An overview of the design of the package.
86-
`vignette("software_design", package = "anndataR")`
87-
- **Development Status**: An overview of the development status of the package.
88-
`vignette("development_status", package = "anndataR")`
89-
- **Known Isses**: An overview of known issues with the package.
74+
- [**Software Design**](https://anndatar.data-intuitive.com/articles/software_design.html): An overview of the design of the package
75+
- [**Development Status**](https://anndatar.data-intuitive.com/articles/development_status.html): An overview of the development status of the package
76+
- [**Known Issues**](https://anndatar.data-intuitive.com/articles/known_issues.html): An overview of known issues with the package.
9077
`vignette("known_issues", package = "anndataR")`

_pkgdown.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ navbar:
99
text: Articles
1010
menu:
1111
- text: Usage
12-
- text: Read/write H5AD files
13-
href: articles/anndataR.html
1412
- text: Read/write Seurat objects
1513
href: articles/usage_seurat.html
1614
- text: Read/write SingleCellExperiment objects

man/write_h5ad.Rd

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/anndataR.Rmd

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ library(SingleCellExperiment)
2828
## Introduction
2929
**{anndataR}** allows users to work with `.h5ad` files, access various slots in the datasets and convert these files to `SingleCellExperiment` objects or `Seurat` objects, and vice versa.
3030
This enables users to move data easily between the different programming languages and analysis ecosystems needed to perform single-cell data analysis.
31-
This package differs from [zellkonverter](https://bioconductor.org/packages/release/bioc/html/zellkonverter.html) because it reads and writes these `.h5ad` files natively in R, and allows conversion to and from `Seurat` objects as well.
32-
33-
Check out `?anndataR` for a full list of the functions provided by this package.
31+
This package differs from [**{zellkonverter}**](https://bioconductor.org/packages/release/bioc/html/zellkonverter.html) because it reads and writes these `.h5ad` files natively in R, and allows conversion to and from `Seurat` objects as well as `SingleCellExperiment`.
3432

3533
## Installation
3634

37-
Install using either **BiocManager** or from GitHub using **pak**:
35+
Install using either **{BiocManager}** or from GitHub using **{pak}**:
3836

3937
```{r, eval = FALSE}
4038
if (!requireNamespace("BiocManager", quietly = TRUE)) {
@@ -62,13 +60,25 @@ library(anndataR)
6260
h5ad_path <- system.file("extdata", "example.h5ad", package = "anndataR")
6361
```
6462

65-
Read an h5ad file in memory:
63+
By default, a H5AD is read to an in-memory `AnnData` object:
6664

6765
```{r read-in-memory}
6866
adata <- read_h5ad(h5ad_path)
6967
```
7068

71-
Read an h5ad file on disk:
69+
It can also be read as a `SingleCellExperiment` object:
70+
71+
```{r read-as-SingleCellExperiment}
72+
sce <- read_h5ad(h5ad_path, as = "SingleCellExperiment")
73+
```
74+
75+
Or as a `Seurat` object:
76+
77+
```{r read-as-Seurat}
78+
obj <- read_h5ad(h5ad_path, as = "Seurat")
79+
```
80+
81+
There is also a HDF5-backed `AnnData` object:
7282

7383
```{r read-on-disk}
7484
adata <- read_h5ad(h5ad_path, as = "HDF5AnnData")
@@ -80,7 +90,7 @@ View structure:
8090
adata
8191
```
8292

83-
Access AnnData slots:
93+
Access `AnnData` slots:
8494

8595
```{r access-slots}
8696
dim(adata$X)
@@ -90,35 +100,35 @@ adata$var[1:5, 1:6]
90100

91101
## Interoperability
92102

93-
Convert the AnnData object to a SingleCellExperiment object:
103+
Convert the `AnnData` object to a `SingleCellExperiment` object:
94104

95105
```{r as-SingleCellExperiment}
96106
sce <- adata$as_SingleCellExperiment()
97107
sce
98108
```
99109

100-
Convert the AnnData object to a Seurat object:
110+
Convert the `AnnData` object to a `Seurat` object:
101111

102112
```{r as-Seurat}
103113
obj <- adata$as_Seurat()
104114
obj
105115
```
106116

107-
Convert a SingleCellExperiment object to an AnnData object:
117+
Convert a `SingleCellExperiment` object to an `AnnData` object:
108118

109119
```{r as-AnnData-from-SingleCellExperiment}
110120
adata <- as_AnnData(sce)
111121
adata
112122
```
113123

114-
Convert a Seurat object to an AnnData object:
124+
Convert a `Seurat` object to an `AnnData` object:
115125

116126
```{r as-AnnData-from-Seurat}
117127
adata <- as_AnnData(obj)
118128
adata
119129
```
120130

121-
## Manually create an object
131+
## Manually create an `AnnData` object
122132

123133
```{r manually-create-object}
124134
adata <- AnnData(
@@ -136,21 +146,21 @@ adata
136146

137147
## Write to disk:
138148

139-
Write an AnnData object to disk:
149+
Write an `AnnData` object to disk:
140150

141151
```{r write-to-disk}
142152
tmpfile <- tempfile(fileext = ".h5ad")
143153
write_h5ad(adata, tmpfile)
144154
```
145155

146-
Write an SCE object to disk:
156+
Write a `SingleCellExperiment` object to disk:
147157

148158
```{r write-SingleCellExperiment-to-disk}
149159
tmpfile <- tempfile(fileext = ".h5ad")
150160
write_h5ad(sce, tmpfile)
151161
```
152162

153-
Write a Seurat object to disk:
163+
Write a `Seurat` object to disk:
154164

155165
```{r write-Seurat-to-disk}
156166
tmpfile <- tempfile(fileext = ".h5ad")

0 commit comments

Comments
 (0)