deTest: Perform differential testing of the distribution measurements...

Description Usage Arguments Value

View source: R/deTest.R

Description

Permutation test is used to get the p-values in differential testing. To keep the possible correlation structure between genes. We run ceiling(N.genes.null/nrow(count.matrix)) rounds of permutation. For each round, we permute cell label once and deconvolve the true expression distribution for all the selected genes with the permuted cell labels. One may need more rounds of permutation to get smaller p-values. See deTest.more. For examples, see descendMultiPop

Usage

1
2
3
4
deTest(descend.multipop.output, de.pair.names, count.matrix, labels,
  N.genes.null = 10000, alternative = c("two.sided", "less",
  "greater"), n.cores = 1, cl = NULL, type = "FORK", verbose = T,
  show.message = T, params = NULL, compare.covariates = T)

Arguments

descend.multipop.output

the returned value of descendMultiPop

de.pair.names

a vector of length 2 showing the two cell population names for differential testing. The names should match the values in labels

count.matrix

the observed UMI count matrix. It should be an R object of class matrix or dgeMatrix. Each row is a gene and each column is a cell. The column sums (which should be the library sizes) are used as the input for scaling.consts when both ercc.matrix and scaling.consts are NULL.

labels

a vector of factors or characters, indicating the cell popluation label of each cell. The length of labels should be the same as the number of columns of count.matrix

N.genes.null

number of permuted genes. The larger the value is, the longer it takes and the smaller the minimum p-value can be (the minimum p-value can be as small as 0.5/N.genes.null)

alternative

the alternative hypotheses for differential testing

n.cores

the number of cores used for parallel computing. Default is 1. Used only when parallel computing is done in a single machine. For using multi-machine cores, need to assign cl explicitly. If verbose is TRUE, then a separated file is created to store the progress of each slave cores.

cl

an object of class "cluster". See more details in makeCluster

type

Default is "FORK" to save memory. Change it to "PSOCK" if you are using Windows and cl is NULL. More details see makeCluster

verbose

verbose the estimation and testing procedures or not. Default is True.

show.message

whether show messages for the computing progresses. Default is TRUE

params

by default, it is descend.multipop.output$params, but users can provide their own in special cases

compare.covariates

whether also perform differential testing on the coefficients of the covaraites Z and Z0. Need to set to FALSE if the number of covariates is not the same in the two cell populations

Value

a list with elements

p.values

a matrix of p-values calculated from permutation tests. Each row is a gene and each column is a distribution measurement of coefficient (if Z or Z0 is presented)

scores

the z-scores matrix in differential testing. Each row is a gene and each column is a distribution measurement of coefficient (if Z or Z0 is presented)

perm.scores

the permuted z-scores matrix used as the null distribution of the z-scores in each column. The number of rows equals to N.genes.null


jingshuw/descend documentation built on Nov. 2, 2021, 4:23 p.m.