spice: SPICE: Spanning tree based inference of co-expression...

Description Usage Arguments Details Value Examples

View source: R/spice.R

Description

This function reconstructs a co-expression network from gene expression profiles.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
spice(
  expr,
  method = "pearson",
  iter = 100,
  frac.gene = 0.8,
  frac.sample = 0.8,
  n.cores = 1,
  rank.ties = "average",
  filter.mat = NULL,
  weight.method = "qnorm",
  adjust.weight = T,
  adjust.weight.powers = c(seq(1, 10, by = 1), seq(12, 20, by = 2)),
  adjust.weight.rsquared = 0.8,
  adjust.weight.bins = 10,
  adjust.clr = F,
  seed = NULL,
  verbose = F
)

Arguments

expr

matrix or data.frame. Processed gene expression data (gene x sample). The rows must have unique gene names.

method

a character string indicating how to compute association between a pair of genes. This must be one of "pearson" (default), "spearman", "mi.empirical", "mi.spearman", and "mi.pearson". See details.

iter

numeric. Number of iterations.

frac.gene

numeric. Fraction of genes used in each iteration.

frac.sample

numeric. Fraction of samples used in each iteration.

n.cores

numeric. The number of cores to use.

rank.ties

a character string indicating how ties are treated in ranking. Accepted values include "average", "first", "last", "random", "max", "min", "dense". For details, see ties.method parameter of frank.

filter.mat

NULL or a gene x gene matrix indicating which edges to exclude. An edge is excluded if the corresponding entry is TRUE or greater than 0. Row and column names of the matrix must be same as rownames(expr).

weight.method

a character string indicating how the weights are assigned. It must be either "qnorm" (default) or "inverse.rank".

adjust.weight

logical. Should the weights be raised to a power to exhibit a scale-free topology.

adjust.weight.powers

numeric vector. Powers for which the scale free topology fit indices are to be calculated.

adjust.weight.rsquared

numeric. Desired minimum scale free topology fitting index R-squared. If no power achieves adjust.weight.rsquared, the power with the maximum R-squared is chosen.

adjust.weight.bins

numeric. Number of bins in connectivity histograms used to compute scale-free fit indices.

adjust.clr

logical. Should the network weights be adjusted using context likelihood or relatedness? See clr for details.

seed

integer or NULL. Random number generator seed.

verbose

logical or numeric. Print messages if verbose > 0.

Details

The expression matrix expr is expected to be properly normalized, processed and free of batch effects. This function may run slow when there are missing values in expr.

Value

Returns a matrix representing a co-expression network.

Examples

1
2
3
4
5
6
7
8
n_gene = 10
n_sample = 100
expr = matrix(rnorm(n_gene * n_sample),
              nrow = n_gene,
              ncol = n_sample,
              dimnames = list(sprintf("Gene%s", seq_len(n_gene)),
                              sprintf("Sample%s", seq_len(n_sample))))
spice_net = spice(expr, iter = 10, verbose = TRUE)

alorchhota/spice documentation built on March 12, 2021, 12:05 a.m.