rewiring_test: Generate stats for the rewiring method.

View source: R/rewiring_stats_functions.R

rewiring_testR Documentation

Generate stats for the rewiring method.

Description

When performing the rewiring test, some stats must be generated in order to proceed with the rewiring method. dave_test() performs a permutation test from a data matrix and a group membership. This function is used in the runrewiring() method.

Usage

rewiring_test(x, grp, perm = 500)

rewiring_test_pair_detail(x, grp, perm = 500)

Arguments

x

data matrix containing subjects as rows and genes as columns.

grp

array indicating the subject group membership.

perm

number of permutations for the test.

Value

list containing the pvalue associated to the rewiring test, the initial t-stat and the t-stat after the permutation test.

Examples


  ## We are going to generate a random matrix `x` and `grp` for the example.
  ## We will use 40 samples and 100 genes. First 25 samples will belong to one group
  ## and the rest (15) to the other.

  mat <- matrix(stats::rnorm(40*100),40,100)
  group_m <- c(rep(1,25),rep(0,15))

  ## Note: the `rewiring_test()` works with group membership (1,2) instead of (0,1)

  results <- rewiring_test(x=mat,grp=1+group_m)


ubioinformat/TraRe documentation built on March 10, 2024, 1:11 a.m.