Learn R Programming

dnapath (version 0.6.4)

dnapath: Differential Network Analysis Using Gene Pathways

Description

Integrates pathways into the differential network analysis of gene expression data grimes19dnapath.

Usage

dnapath(
  x,
  pathway_list,
  groups = NULL,
  network_inference = run_pcor,
  n_perm = 100,
  lp = 2,
  seed = NULL,
  verbose = FALSE,
  ...
)

Arguments

x

The gene expression data to be analyzed. This can be either (1) a list of two matrices or data frames that contain the gene expression profile from each of two populations (groups) -- with rows corresponding to samples and columns to genes -- or (2) a single matrix or data frame that contains the expression profiles for both groups. For case (2), the groups argument must be specified to identify which rows belong to which group.

pathway_list

A single vector or list of vectors containing gene names to indicate pathway membership. The vectors are used to subset the columns of the matrices in x. A pathway list can be obtained using get_reactome_pathways.

groups

If x is a single matrix or data frame, groups must be specified to label each row. groups is a vector of length equal to the number of rows in x, and it should contain two unique elements (the two group names).

network_inference

A function used to infer the pathway network. It should take in an n by p matrix and return a p by p matrix of association scores. (Built-in options include: run_aracne, run_bc3net, run_c3net, run_clr, run_corr, run_dwlasso, run_genie3, run_glasso, run_mrnet, run_pcor, and run_silencer.) Defaults to run_pcor for partial correlations.

n_perm

The number of random permutations to perform during permutation testing. If n_perm == 1, the permutation tests are not performed. If n_perm is larger than the number of possible permutations, n_perm will be set to this value with a warning message.

lp

The lp value used to compute differential connectivity scores. (Note: If a vector is provided, then the results are returned as a list of dnapath_list objects, one result for each value of lp. This option is available so that network inference methods only need to be run once for each pathway when multple values of lp are being considered. This may be useful when conducting simulation studies).

seed

(Optional) Used to set.seed prior to permutation test for each pathway. This allows results for individual pathways to be easily reproduced.

verbose

Set to TRUE to turn on messages.

...

Additional arguments are passed into the network inference function.

Value

A 'dnapath_list' or 'dnapath' object containing results for each pathway in pathway_list.

References

grimes19dnapath

See Also

filter_pathways, summary.dnapath_list subset.dnapath_list, sort.dnapath_list, plot.dnapath, rename_genes

Examples

Run this code
# NOT RUN {
data(meso)
data(p53_pathways)
set.seed(0)
results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways,
                   groups = meso$groups, n_perm = 10)
results
summary(results) # Summary over all pathways in the pathway list.
# Remove results for pathways with p-values above 0.2.
top_results <- filter_pathways(results, 0.2)
# Sort the top results by the pathway DC score.
top_results <- sort(top_results, by = "dc_score")
top_results
summary(top_results[[1]])  # Summary of pathway 1.
plot(results[[1]]) # Plot of the differential network for pathway 1.

# Use ... to adjust arguments in the network inference function.
# For example, using run_corr() with method = "spearman":
results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways,
                   groups = meso$groups, n_perm = 10,
                   network_inference = run_corr,
                   method = "spearman")
results
# }

Run the code above in your browser using DataLab