Skip to contents

Stat Database Attributes.

Usage

StatDBAttribute(
  df = NULL,
  filter,
  database = c("PanglaoDB", "UCSC", "CELLxGENE", "HCA"),
  combine = FALSE,
  use.census = FALSE,
  census.version = "stable",
  organism = NULL
)

Arguments

df

All metadata, can be PanglaoDBMeta and obtained with ShowCBDatasets, ShowCELLxGENEDatasets, and ShowHCAProjects. Skip when use.census is TRUE. Default: NULL.

filter

Vector of attributes.

database

Database name, choose from "PanglaoDB", "UCSC", "CELLxGENE", "HCA". Default: "PanglaoDB".

combine

Logical value, whether to combine all attributes in filter for summarising. Default: FALSE.

use.census

Logical value, whether to use CZ CELLxGENE Census to summarise metadata. Default: FALSE.

census.version

The version of the Census, e.g., "2024-05-13", or "latest" or "stable". Default: stable.

organism

Organism, should be in lower case and replace space with '_'. Default: FALSE (human).

Value

List of attributes information (attribute, value and number) when combine is FALSE, dataframe when combine is TRUE.

Examples

if (FALSE) {
# PanglaoDB
StatDBAttribute(df = PanglaoDBMeta, filter = c("species", "protocol"), database = "PanglaoDB")
# UCSC Cell Browser, need users to provide the json folder
ucsc.cb.samples <- ShowCBDatasets(lazy = TRUE, json.folder = NULL, update = FALSE)
StatDBAttribute(df = ucsc.cb.samples, filter = c("organism", "organ"), database = "UCSC")
# CELLxGENE
all.cellxgene.datasets <- ShowCELLxGENEDatasets()
StatDBAttribute(
  df = all.cellxgene.datasets, filter = c("organism", "sex"),
  database = "CELLxGENE"
)
# HCA
all.hca.projects <- ShowHCAProjects()
StatDBAttribute(df = all.hca.projects, filter = c("organism", "sex"), database = "HCA")
}