Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Bioconductor vignette standards #112

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Imports:
R6
Suggests:
anndata,
BiocStyle,
knitr,
reticulate,
rhdf5,
Expand Down
38 changes: 34 additions & 4 deletions vignettes/getting-started.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
---
title: "Getting Started"
output: rmarkdown::html_vignette
title: "Using anndataR to read and convert"
shorttitle: "Using anndataR"
author:
- name: Robrecht Cannoodt
- name: Luke Zappia
- name: Martin Morgan
- name: Louise Deconinck
package: anndataR
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Getting Started}
%\VignetteIndexEntry{Using anndataR to read and convert}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -14,10 +21,24 @@
)
```

# Introduction

This package allows users to work with `.h5ad` files, access various slots in the datasets and convert these files to `SingleCellExperiment` objects and `SeuratObject`s, and vice versa.

Check out `?anndataR` for a full list of the functions provided by this package.

# Installation

Install using:
```{r, eval = FALSE}
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")

Check warning on line 36 in vignettes/getting-started.Rmd

View workflow job for this annotation

GitHub Actions / lint

file=vignettes/getting-started.Rmd,line=36,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
BiocManager::install("BiocStyle")
```

# Usage

This package provides an abstract interface for `AnnData` objects. This abstract interface models its Python counterpart closely, and stores a data matrix `X` and annotations corresponding to observations (`obs`, `obsm`, `obsp`) and variables (`var`, `varm`, `varp`) and unstructured metadata `uns`.


Expand All @@ -30,6 +51,8 @@
The `InMemoryAnnData` backend allows you to construct an `AnnData` object in memory.
The `HDF5AnnData` backend allows you to read in an `AnnData` object from an `.h5ad` file.

## `HDF5AnnData` backend

Here is an example of how to read in an `.h5ad` file.

```{r setup}
Expand All @@ -49,10 +72,11 @@
var <- adata$var
```

## `InMemoryAnnData` backend

The following example details how to construct an InMemoryAnnData and access its contents.

```{r inmemory_construct}

adata <- AnnData(
X = matrix(1:15, 3L, 5L),
layers = list(
Expand Down Expand Up @@ -82,3 +106,9 @@
seurat <- to_Seurat(adata)
```

# Session info

```{r}
sessionInfo()
```

Loading