cal_w2_bulk_pval: Calculate p-value for a given gene based on bulk RNAseq. The...

View source: R/op_functions.R

cal_w2_bulk_pvalR Documentation

Calculate p-value for a given gene based on bulk RNAseq. The expressions are represented as one numerical value per gene, per individual.

Description

Calculate p-value for a given gene based on bulk RNAseq. The expressions are represented as one numerical value per gene, per individual.

Usage

cal_w2_bulk_pval(
  cur_ind_count,
  cur_individual,
  phenotype,
  perm_num = 500,
  unif_round_unit = 0.2
)

Arguments

cur_ind_count

vector of gene counts (length = number of individuals).

cur_individual

individual annotations (length = number of individuals).

phenotype

0/1 individual labels (length = number of individuals, 0=control, 1=case).

perm_num

number of permutations for computing p-value (integer).

unif_round_unit

Bin width for empirical histogram (default: 0.2).

Value

a list contains:

  • pval: p-value

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

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

Examples

## Not run: 
count_per_gene=c(rpois(6,10),c(rpois(6,4)))
meta_individual=paste0("ind",rep(1:12,each=1))
meta_phenotype=c(rep(1,6),rep(0,6))
cal_w2_bulk_pval(count_per_gene,meta_individual,meta_phenotype)

## End(Not run)


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