cal_w2_pval: This function calculates the BSDE Barycenter p-value of a...

View source: R/op_functions.R

cal_w2_pvalR Documentation

This function calculates the BSDE Barycenter p-value of a given gene.

Description

This function calculates the BSDE Barycenter p-value of a given gene.

Usage

cal_w2_pval(
  count_per_gene,
  meta_individual,
  meta_phenotype,
  perm_num = 200,
  unif_round_unit = 0.2,
  weight = 1,
  shrink = FALSE
)

Arguments

count_per_gene

Gene count. Vector of length n (n is number of cells).

meta_individual

Label of individuals (length n).

meta_phenotype

0/1 vector of length n (0=control, 1=case).

perm_num

Number of random permutations for computing p-value.

unif_round_unit

Bin width for empirical histogram (default: 0.2).

weight

Weight vector (non-negative, length=number of subjects) for subjects. Can be used for inverse probability weighting to control for confounding. Default: 1 for equal weights.

shrink

If TRUE, the range with zero count will be removed to cope with sparsity and speed up the computation. Use TRUE if extremely high expressions are present. Default: FALSE.

Value

a list contains:

  • pval: p-value

  • case_bc_ob: density of the aggregated Barycenter distribution of the cases

  • ctrl_bc_ob: density of the aggregated Barycenter distribution of the controls


mqzhanglab/BSDE documentation built on March 20, 2022, 5:17 a.m.