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

Update R docs and doc-site #684

Merged
merged 16 commits into from
Aug 4, 2023
Merged
83 changes: 65 additions & 18 deletions api/r/cellxgene.census/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,86 @@

# CZ CELLxGENE Discover Census
# R package of CZ CELLxGENE Discover Census

<!-- badges: start -->
<!-- badges: end -->

This is the documentation for the R package `cellxgene.census` which is part of CZ CELLxGENE Discover Census. For full details on Census data and capabilities please go to the [main Census site](https://chanzuckerberg.github.io/cellxgene-census/).

The `cellxgene.census` package provides an API to facilitate the use of the CZ CELLxGENE Discover Census. For more information about the API and the project visit the [chanzuckerberg/cellxgene-census GitHub repo](https://github.com/chanzuckerberg/cellxgene-census/).
`cellxgene.census` provides an API to efficiently access the cloud-hosted Census single-cell data from R. In just a few seconds users can access any slice of Census data using cell or gene filters across hundreds of single-cell datasets.

**Status**: Pre-release, under rapid development. Expect API changes.

Also see the [Python API](https://cellxgene-census.readthedocs.io/).
Census data can be fetched in an iterative fashion for bigger-than-memory slices of data, or quickly exported to basic R structures, as well as `Seurat` or `SingleCellExperiment` objects for downstream analysis.

## Installation

You can install the development version of `cellxgene.census` from [GitHub](https://github.com/) with:
From an R session, first install `tiledb` from R-Universe, as the latest release in CRAN is not yet available.

```r
install.packages(
"tiledb",
version = "0.20.2",
repos=c('https://tiledb-inc.r-universe.dev','https://cloud.r-project.org')
)
```

Then install `cellxgene.census` from R-Universe.

``` r
# install.packages("devtools")
devtools::install_github("chanzuckerberg/cellxgene-census/api/r/cellxgene.census")
print(cellxgene.census::open_soma())
```r
install.packages(
"cellxgene.census",
repos=c('https://tiledb-inc.r-universe.dev','https://cloud.r-project.org')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repos=c('https://tiledb-inc.r-universe.dev','https://cloud.r-project.org')
repos=c('https://chanzuckerberg.r-universe.dev','https://cloud.r-project.org')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

)
```

(minimal apt dependencies: r-base cmake git)
## Usage

Check out the vignettes in the "Articles" section of the navigation bar on this site. We highly recommend the following vignettes as a starting point:

* [Querying and fetching the single-cell data and cell/gene metadata](./articles/census_query_extract.html)
* [Learning about the CZ CELLxGENE Discover Census](./articles/comp_bio_census_info.html)

You can also check out out the [quick start guide](https://chanzuckerberg.github.io/cellxgene-census/cellxgene_census_docsite_quick_start.html) in the main Census site.


### Example `Seurat` and `SingleCellExperiment` query

The following creates a `Seurat` object on-demand with all sympathetic neurons in Census and filtering only for the genes `ENSG00000161798`, `ENSG00000188229`.

```r
library("cellxgene.census")
library("Seurat")

census <- open_soma()

organism <- "Homo sapiens"
gene_filter <- "feature_id %in% c('ENSG00000107317', 'ENSG00000106034')"
cell_filter <- "cell_type == 'sympathetic neuron'"
cell_columns <- c("assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease")

seurat_obj <- get_seurat(
census = census,
organism = organism,
var_value_filter = gene_filter,
obs_value_filter = cell_filter,
obs_column_names = cell_columns
)
```

## Example
And the following retrieves the same data as a `SingleCellExperiment` object.

This is a basic example which shows you how to solve a common problem:
```r
library("SingleCellExperiment")

``` r
library(cellxgene.census)
## basic example code
sce_obj <- get_single_cell_experiment(
census = census,
organism = organism,
var_value_filter = gene_filter,
obs_value_filter = cell_filter,
obs_column_names = cell_columns
)
```

## For More Help

For more help, please file a issue on the repo, or contact us at <soma@chanzuckerberg.com>
For more help, please go visit the [main Census site](https://chanzuckerberg.github.io/cellxgene-census/).

If you believe you have found a security issue, we would appreciate notification. Please send email to <security@chanzuckerberg.com>.
If you believe you have found a security issue, we would appreciate notification. Please send an email to <security@chanzuckerberg.com>.
68 changes: 52 additions & 16 deletions api/r/cellxgene.census/docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/r/cellxgene.census/docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ articles:
comp_bio_census_info: comp_bio_census_info.html
comp_bio_data_integration: comp_bio_data_integration.html
comp_bio_summarize_axis_query: comp_bio_summarize_axis_query.html
last_built: 2023-08-02T19:37Z
last_built: 2023-08-03T18:54Z

2 changes: 1 addition & 1 deletion api/r/cellxgene.census/docs/search.json

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions docs/cellxgene_census_docsite_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ If installing in a Databricks notebook environment, use `%pip install`. Do not u

## R

The R package will be soon deposited into R-Universe. In the meantime you can directly install from github using the [devtools](https://devtools.r-lib.org/) R package.

From an R session:
From an R session, first install `tiledb` from R-Universe, the latest release in CRAN is not yet available.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
From an R session, first install `tiledb` from R-Universe, the latest release in CRAN is not yet available.
From an R session, first install `tiledb` from R-Universe, as the latest release in CRAN is not yet available.


```r
install.packages("devtools")
devtools::install_github("chanzuckerberg/cellxgene-census/api/r/cellxgene.census")
install.packages(
"tiledb",
version = "0.20.2",
repos=c('https://tiledb-inc.r-universe.dev','https://cloud.r-project.org')
)
```

Then install `cellxgene.census` from R-Universe.

```r
install.packages(
"cellxgene.census",
repos=c('https://tiledb-inc.r-universe.dev','https://cloud.r-project.org')
)
```
Loading
Loading