networkTest: Network equality test

networkTestR Documentation

Network equality test

Description

Test of equality between network properties

Usage

degreeCentralityTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

betweennessCentralityTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

closenessCentralityTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

eigenvectorCentralityTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

clusteringCoefficientTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

edgeBetweennessTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = NULL,
  BPPARAM = NULL
)

degreeDistributionTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = list(bandwidth = "Sturges"),
  BPPARAM = NULL
)

spectralEntropyTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = list(bandwidth = "Sturges"),
  BPPARAM = NULL
)

spectralDistributionTest(
  expr,
  labels,
  adjacencyMatrix,
  numPermutations = 1000,
  options = list(bandwidth = "Sturges"),
  BPPARAM = NULL
)

Arguments

expr

Matrix of variables (columns) vs samples (rows)

labels

a vector in which a position indicates the phenotype of the corresponding sample or state

adjacencyMatrix

a function that returns the adjacency matrix for a given variables values matrix

numPermutations

number of permutations that will be carried out in the permutation test

options

a list containing parameters. Used only in degreeDistributionTest, spectralEntropyTest and spectralDistributionTest functions. It can be set to either list(bandwidth="Sturges") or list(bandwidth="Silverman").

BPPARAM

An optional BiocParallelParam instance determining the parallel back-end to be used during evaluation, or a list of BiocParallelParam instances, to be applied in sequence for nested calls to BiocParallel functions. MulticoreParam()

Value

A list containing: "measure" - difference among two or more networks associated with each phenotype. To compare networks by centralities and clustering coefficient, one uses euclidian distance. In spectral entropy comparison, one uses the absolute difference. In distributions (spectral and degree) comparison, one uses Kulback-Liebler divergence. "p.value" - the Nominal p-value of the test. "Partial" - a vector with the weigths of each network in a measure value.

Examples

set.seed(1)
data("varFile")
gliomaData <- system.file("extdata", "variablesValue_BioNetStat_tutorial_data.csv", package = "BioNetStat")
labels<-doLabels(gliomaData)
adjacencyMatrix1 <- adjacencyMatrix(method="spearman", association="pvalue",
 threshold="fdr", thr.value=0.05, weighted=FALSE)
# The numPermutations number is 1 to do a faster example, but we advise to use unless 1000 permutations in real analysis

# Degree centrality test
diffNetAnalysis(method=degreeCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Betweenness centrality test
diffNetAnalysis(method=betweennessCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Closeness centrality test
diffNetAnalysis(method=closenessCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Eigenvector centrality test
diffNetAnalysis(method=eigenvectorCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Clustering coefficient test
diffNetAnalysis(method=clusteringCoefficientTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Edge betweenness centrality test
diffNetAnalysis(method=edgeBetweennessTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

# Degree distribution test
diffNetAnalysis(method=degreeDistributionTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, options=list(bandwidth="Sturges"))

# Spectral entropy test
 diffNetAnalysis(method=spectralEntropyTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, options=list(bandwidth="Sturges"))

# Spectral distribution test
 diffNetAnalysis(method=spectralDistributionTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, options=list(bandwidth="Sturges"))

jardimViniciusC/BioNetStat documentation built on July 3, 2022, 3:32 a.m.