# Creates a set of sample path p-values for each length given a weighted network

### Description

Randomly traverses paths of increasing lengths within a set network to create an empirical pathway distribution for more accurate determination of path significance.

### Usage

1 2 | ```
samplePaths(graph, max.path.length, num.samples = 1000, num.warmup = 10,
verbose = TRUE)
``` |

### Arguments

`graph` |
A weighted igraph object. Weights must be in |

`max.path.length` |
The maxmimum path length. |

`num.samples` |
The numner of paths to sample |

`num.warmup` |
The number of warm up paths to sample. |

`verbose` |
Whether to display the progress of the function. |

### Details

Can take a bit of time.

### Value

A matrix where each row is a path length and each column is the number of paths sampled.

### Author(s)

Timothy Hancock

Ahmed Mohamed

### See Also

Other Path ranking methods: `extractPathNetwork`

,
`getPathsAsEIDs`

, `pathRanker`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
## Prepare a weighted reaction network.
## Conver a metabolic network to a reaction network.
data(ex_sbml) # bipartite metabolic network of Carbohydrate metabolism.
rgraph <- makeReactionNetwork(ex_sbml, simplify=TRUE)
## Assign edge weights based on Affymetrix attributes and microarray dataset.
# Calculate Pearson's correlation.
data(ex_microarray) # Part of ALL dataset.
rgraph <- assignEdgeWeights(microarray = ex_microarray, graph = rgraph,
weight.method = "cor", use.attr="miriam.uniprot",
y=factor(colnames(ex_microarray)), bootstrap = FALSE)
## Get significantly correlated paths using "p-valvue" method.
## First, establish path score distribution by calling "samplePaths"
pathsample <- samplePaths(rgraph, max.path.length=10,
num.samples=100, num.warmup=10)
## Get all significant paths with p<0.1
significant.p <- pathRanker(rgraph, method = "pvalue",
sampledpaths = pathsample ,alpha=0.1)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.