vec_chisq_test: Vectorized Chi-squared tests for differential gene detection

View source: R/de.genes.R

vec_chisq_testR Documentation

Vectorized Chi-squared tests for differential gene detection

Description

This function uses vectors of the number of samples in two sets that have detection of a set of genes and the total number of cells in each set to compute Chi-quared tests with 1 DOF for differential detection.

Usage

vec_chisq_test(x, x.total, y, y.total)

Arguments

x

an integer vector with the number of cells in group x with detection of each gene.

x.total

an integer value with the total number of cells in group x.

y

an integer vector with the number of cells in group y with detection of each gene.

y.total

an integer value with the total number of cells in group y.

Value

a data.frame with the following result for each gene:

  • stats: The value of the chi-squared test statistic

  • pval: The p-value as reported by pchisq

  • logFC: The log2(fold change) in detection frequency between samples (x / y)

  • diff: The difference in proportions between the samples (x - y)


AllenInstitute/scrattch.hicat documentation built on Oct. 20, 2023, 6:55 a.m.