diffNetAnalysis: Differential network analysis method

View source: R/loading_files.R

diffNetAnalysisR Documentation

Differential network analysis method

Description

Differential network analysis method

Usage

diffNetAnalysis(
  method,
  options = list(bandwidth = "Sturges"),
  varFile,
  labels,
  varSets = NULL,
  adjacencyMatrix,
  numPermutations = 1000,
  print = TRUE,
  resultsFile = NULL,
  seed = NULL,
  min.vert = 5,
  BPPARAM = NULL,
  na.rm = NULL
)

Arguments

method

a function that receives two adjacency matrices and returns a list containing a statistic theta that measures the difference between them, and a p-value for the test H0: theta = 0 against H1: theta > 0.

options

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

varFile

a numeric matrix contaning variables values data.

labels

a vector of -1s, 0s, and 1s associating each sample with a phenotype. The value 0 corresponds to the first phenotype class of interest, 1 to the second phenotype class of interest, and -1 to the other classes, if there are more than two classes in the gene expression data.

varSets

a list of gene sets. Each element of the list is a character vector v, where v[1] contains the gene set name, v[2] descriptions about the set, v[3..length(v)] the genes that belong to the set.

adjacencyMatrix

a function that receives a numeric matrix containing gene expression data and returns the adjacency matrix of the inferred co-expression graph.

numPermutations

the number of permutations for the permutation test.

print

a logical. If true, it prints execution messages on the screen. resultsFile: path to a file where the partial results of the analysis will be saved. If NULL, then no partial results are saved.

resultsFile

a ".RData" file name to be saved in tha work directory.

seed

the seed for the random number generators. If it is not null then the sample permutations are the same for all the gene sets.

min.vert

lower number of nodes (variables) that has to be to compare the networks.

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()

na.rm

remove the NA values by excluding the rows ("row") or the columns ("col") that contaings it. If NULL (default) the NA values are not removed.

Value

a data frame containing the name, size, test statistic, nominal p-value and adjusted p-value (q-value) associated with each gene set.

Examples

# Glioma data
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)
diffNetAnalysis(method=degreeCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=1, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)
# The numPermutations number is 1 to do a faster example, but we advise to use unless 1000 permutations in real analysis
  
# Random data
set.seed(1)
varFile <- as.data.frame(matrix(rnorm(120),40,30))
labels<-data.frame(code=rep(0:3,10),names=rep(c("A","B","C","D"),10))
adjacencyMatrix1 <- adjacencyMatrix(method="spearman", association="pvalue", threshold="fdr",
 thr.value=0.05, weighted=FALSE)
diffNetAnalysis(method=degreeCentralityTest, varFile=varFile, labels=labels, varSets=NULL,
 adjacencyMatrix=adjacencyMatrix1, numPermutations=10, print=TRUE, resultsFile=NULL,
  seed=NULL, min.vert=5, option=NULL)

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