pkgdown/extra.html

Skip to contents

Keep high-quality cells based on QC columns

Usage

keep_quality_cells(
  data,
  empty_droplet_col = "empty_droplet",
  alive_col = "alive",
  doublet_col = "scDblFinder.class"
)

Arguments

data

A data frame or tibble containing single-cell metadata.

empty_droplet_col

A string specifying the column name that indicates empty droplets (default: "empty_droplet"). Expected logical vector

alive_col

A string specifying the column name that indicates whether cells are alive (default: "alive"). Expected logical vector

doublet_col

A string specifying the column name that indicates doublets (default: "scDblFinder.class"). Expected character vector: "doublet" and/or "singlet" and/or "unknown".

Value

A filtered data frame containing only cells that pass all QC checks.

Examples

get_metadata(cloud_metadata = SAMPLE_DATABASE_URL, cache_directory = tempdir()) |>
  head(2) |>
  keep_quality_cells()
#> # Source:   SQL [?? x 73]
#> # Database: DuckDB 1.5.2 [unknown@Linux 6.17.0-1010-azure:R 4.7.0/:memory:]
#>   cell_id observation_joinid dataset_id    sample_id sample_ cell_count citation
#>     <dbl> <chr>              <chr>         <chr>     <chr>        <int> <chr>   
#> 1      15 TjgA2vJ1;{         842c6f5d-4a9… 1119f482… 1119f4…     714331 Publica…
#> 2      19 lNmuO5xs~3         842c6f5d-4a9… 1119f482… 1119f4…     714331 Publica…
#> # ℹ 66 more variables: collection_id <chr>, dataset_version_id <chr>,
#> #   default_embedding <chr>, experiment___ <chr>, explorer_url <chr>,
#> #   feature_count <int>, filesize <dbl>, filetype <chr>,
#> #   mean_genes_per_cell <dbl>, primary_cell_count <chr>, published_at <chr>,
#> #   raw_data_location <chr>, revised_at <chr>, run_from_cell_id <chr>,
#> #   sample_heuristic <chr>, schema_version <chr>, suspension_type <chr>,
#> #   tissue_type <chr>, title <chr>, tombstone <lgl>, url <chr>, …