R: Wrapper for partial correlations from corpcor

run_pcor {dnapath} | R Documentation

## Wrapper for partial correlations from corpcor

### Description

Conducts co-expression analysis using full partial correlations; these are computed using the shrinkage approach for covariance estimation (Schäfer and Strimmer 2005) from the `corpcor` package (Schafer et al. 2017). Can be used for the `network_inference` argument in `dnapath`.

### Usage

    run_pcor(x, weights = NULL, ranks = FALSE, verbose = FALSE, ...)

### Arguments

`x` | A n by p matrix of gene expression data (n samples and p genes).
`weights` | An optional vector of weights. This is used by `dnapath()` to apply the probabilistic group labels to each observation when estimating the group-specific network.
`ranks` | If TRUE, the gene expression values will be converted to ranks (across samples) prior to covariance estimation.
`verbose` | Argument is passed into `pcor.shrink`.
`...` | Additional arguments are ignored.

### Value

A p by p matrix of association scores.

### References

Schäfer J, Strimmer K (2005). “A Shrinkage Approach to Large-Scale Covariance Matrix Estimation and Implications for Functional Genomics.” Statistical Applications in Genetics and Molecular Biology, 4(1), Article 32.

Schafer J, Opgen-Rhein R, Zuber V, Ahdesmaki M, Silva APD, Strimmer. K (2017). corpcor: Efficient Estimation of Covariance and (Partial) Correlation. R package version 1.6.9, https://CRAN.R-project.org/package=corpcor.

### See Also

`run_aracne`, `run_bc3net`, `run_c3net`, `run_clr`, `run_corr`, `run_dwlasso`, `run_genie3`, `run_glasso`, `run_mrnet`, and `run_silencer`

### Examples

    data(meso)
    data(p53_pathways)

    # To create a short example, we subset on two pathways from the p53 pathway list,
    # and will only run 3 permutations for significance testing.
    pathway_list <- p53_pathways[c(8, 13)]
    n_perm <- 3

    # Use this method to perform differential network analysis.
    results <- dnapath(x = meso$gene_expression,
                       pathway_list = pathway_list,
                       group_labels = meso$groups,
                       n_perm = n_perm,
                       network_inference = run_pcor)
    summary(results)

    # The group-specific association matrices can be extracted using get_networks().
    nw_list <- get_networks(results[[1]]) # Get networks for pathway 1.

    # nw_list has length 2 and contains the inferred networks for the two groups.
    # The gene names are the Entrezgene IDs from the original expression dataset.
    # Renaming the genes in the dnapath results to rename those in the networks.
    # NOTE: The temporary directory, tempdir(), is used in this example. In practice,
    #       this argument can be removed or changed to an existing directory
    results <- rename_genes(results, to = "symbol", species = "human",
                            dir_save = tempdir())
    nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names.

    # (Optional) Plot the network using SeqNet package (based on igraph plotting).
    # First rename entrezgene IDs into gene symbols.
    SeqNet::plot_network(nw_list[[1]])

[Package dnapath version 0.7.4 Index]