Learn R Programming

nethet (version 1.4.2)

ggmgsa_multisplit: Multi-split GGMGSA (parallelized computation)

Description

Multi-split GGMGSA (parallelized computation)

Usage

ggmgsa_multisplit(x1, x2, b.splits = 50, gene.sets, gene.names,
  gs.names = NULL, method.p.adjust = "fdr", order.adj.agg = "agg-adj",
  mc.flag = FALSE, mc.set.seed = TRUE, mc.preschedule = TRUE,
  mc.cores = getOption("mc.cores", 2L), verbose = TRUE, ...)

Arguments

x1
Expression matrix for condition 1 (mean zero is required).
x2
Expression matrix for condition 2 (mean zero is required).
b.splits
Number of random data splits (default=50).
gene.sets
List of gene-sets.
gene.names
Gene names. Each column in x1 (and x2) corresponds to a gene.
gs.names
Gene-set names (default=NULL).
method.p.adjust
Method for p-value adjustment (default='fdr').
order.adj.agg
Order of aggregation and adjustment of p-values. Options: 'agg-adj' (default), 'adj-agg'.
mc.flag
If TRUE use parallel execution for each b.splits via function mclapply of package parallel.
mc.set.seed
See mclapply. Default=TRUE
mc.preschedule
See mclapply. Default=TRUE
mc.cores
Number of cores to use in parallel execution. Defaults to mc.cores option if set, or 2 otherwise.
verbose
If TRUE, show output progess.
...
Other arguments (see diffnet_singlesplit).

Value

  • List consisting of
  • medagg.pvalMedian aggregated p-values
  • meinshagg.pvalMeinshausen aggregated p-values
  • pvalmatrix of p-values before correction and adjustement, dim(pval)=(number of gene-sets)x(number of splits)
  • teststatmedmedian aggregated test-statistic
  • teststatmed.bicmedian aggregated bic-corrected test-statistic
  • teststatmed.aicmedian aggregated aic-corrected test-statistic
  • teststatmatrix of test-statistics, dim(teststat)=(number of gene-sets)x(number of splits)
  • rel.edgeinternormalized intersection of edges in condition 1 and 2
  • df1degrees of freedom of GGM obtained from condition 1
  • df2degrees of freedom of GGM obtained from condition 2
  • df12degrees of freedom of GGM obtained from pooled data (condition 1 and 2)

Details

Computation can be parallelized over many data splits.

Examples

Run this code
#######################################################
##This example illustrates the use of GGMGSA         ##
#######################################################


## Generate networks
set.seed(1)
p <- 9#network with p nodes
n <- 40
hub.net <- generate_2networks(p,graph='hub',n.hub=3,n.hub.diff=1)#generate hub networks
invcov1 <- hub.net[[1]]
invcov2 <- hub.net[[2]]
plot_2networks(invcov1,invcov2,label.pos=0,label.cex=0.7)

## Generate data
library('mvtnorm')
x1 <- rmvnorm(n,mean = rep(0,p), sigma = cov2cor(solve(invcov1)))
x2 <- rmvnorm(n,mean = rep(0,p), sigma = cov2cor(solve(invcov2)))

## Run DiffNet
# fit.dn <- diffnet_multisplit(x1,x2,b.splits=2,verbose=FALSE)
# fit.dn$medagg.pval

## Identify hubs with 'gene-sets'
gene.names <- paste('G',1:p,sep='')
gsets <- split(gene.names,rep(1:3,each=3))

## Run GGM-GSA
fit.ggmgsa <- ggmgsa_multisplit(x1,x2,b.splits=2,gsets,gene.names,verbose=FALSE)
summary(fit.ggmgsa)
fit.ggmgsa$medagg.pval#median aggregated p-values
p.adjust(apply(fit.ggmgsa$pval,1,median),method='fdr')#or: first median aggregation,
                                                      #second fdr-correction

Run the code above in your browser using DataLab