make_qc_dt: Checks specified QC metrics and makes data.table for input to...

View source: R/make_qc_dt.R

make_qc_dtR Documentation

Checks specified QC metrics and makes data.table for input to calc_pairwise_mmds.

Description

Takes a data.frame of raw QC metrics, and makes a nice neat data.table output that can be used in SampleQC. For example, users with a SingleCellExperiment object sce may first run scater::calculateQCMetrics, then call make_qc_dt(colData(sce)). We work with data.frame/data.table objects to have the most flexible possible approach (and to save work on e.g. keeping up with changes to dependencies like SingleCellExperiment and Seurat).

Usage

make_qc_dt(
  qc_df,
  sample_var = "sample_id",
  qc_names = c("log_counts", "log_feats", "logit_mito"),
  annot_vars = NULL
)

Arguments

qc_df

data.frame object containing calculated QC metrics

sample_var

which column of qc_df has sample labels? (e.g. sample, group, batch, library)

qc_names

list of qc_names that need to be extracted

annot_vars

list of user-specified sample-level annotations

Details

This code also calculates some sample-level statistics, e.g. median log library size per sample, and adds columns with binned values for these.

Value

qc_dt, a data.table containing the sample variable plus qc metrics


wmacnair/SampleQC documentation built on Nov. 18, 2022, 5 p.m.