calculate_QC_metrics {scPipe} | R Documentation

## Calcuate QC metrics from gene count matrix

### Description

Calcuate QC metrics from gene count matrix

### Usage

    calculate_QC_metrics(sce)

### Arguments

`sce` | a `SingleCellExperiment` object containing gene counts

### Details

get QC metrics using gene count matrix. The QC statistics added are

- number_of_genes number of genes detected.

- total_count_per_cell sum of read number after UMI deduplication.

- non_mt_percent 1 - percentage of mitochondrial gene counts. Mitochondrial genes are retrived by GO term GO:0005739

- non_ERCC_percent ratio of exon counts to ERCC counts

- non_ribo_percent 1 - percentage of ribosomal gene counts ribosomal genes are retrived by GO term GO:0005840.

### Value

an `SingleCellExperiment` with updated QC metrics

### Examples

    data("sc_sample_data")
    data("sc_sample_qc")
    sce = SingleCellExperiment(assays = list(counts = as.matrix(sc_sample_data)))
    organism(sce) = "mmusculus_gene_ensembl"
    gene_id_type(sce) = "ensembl_gene_id"
    QC_metrics(sce) = sc_sample_qc
    demultiplex_info(sce) = cell_barcode_matching
    UMI_dup_info(sce) = UMI_duplication

    # The sample qc data already run through function `calculate_QC_metrics`.
    # So we delete these columns and run `calculate_QC_metrics` to get them again:
    colnames(colnames(QC_metrics(sce)))
    QC_metrics(sce) = QC_metrics(sce)[,c("unaligned","aligned_unmapped","mapped_to_exon")]
    sce = calculate_QC_metrics(sce)
    colnames(QC_metrics(sce))

[Package scPipe version 1.8.0 Index]