diffuse_mc {diffuStats} | R Documentation

## Compute the heatrank using permutations

### Description

Function `diffuse_mc` has an implemented parallelisation of the Monte Carlo trials for diffusion in a network. The input scores are assumed to be sparse and are internally sparsified, so very dense scores migth take time with current implementation.

### Usage

    diffuse_mc(
        graph,
        scores,
        n.perm = 10000,
        sample.prob = NULL,
        seed = 1,
        oneminusHeatRank = TRUE,
        K = NULL,
        ...
    )

### Arguments

`graph` | igraph object
`scores` | Recursive list, can have either binary or quantitative scores
`n.perm` | Numeric, number of permutations
`sample.prob` | Numeric, probabilities (needn't be scaled) to permute the input. This is passed to `sample`'s `prob` argument. If `NULL`, sampling is uniform. It has to be in a list format, with the same names as `scores`, and each element of the list must be the sampling probability of each background.
`seed` | Numeric, seed for random number generator
`oneminusHeatRank` | Logical, should `1 - heatrank` be returned instead of `heatrank`?
`K` | Kernel matrix (if precomputed). If `K` is not supplied, the regularised Laplacian will be computed on the fly and used.
`...` | currently ignored arguments

### Value

A list containing matrices of heatrank scores

### Examples

    # Using a list as input (needed)
    data(graph_toy)
    list_input <- list(myInput1 = graph_toy$input_mat)
    diff_mc <- diffuse_mc(
        graph = graph_toy,
        scores = list_input)

[Package diffuStats version 1.10.2 Index]