man/samplePaths.Rd
2aadfaf5
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/pathRank.R
96e22bfc
 \name{samplePaths}
 \alias{samplePaths}
 \title{Creates a set of sample path p-values for each length given a weighted network}
 \usage{
087265c8
 samplePaths(graph, max.path.length, num.samples = 1000,
   num.warmup = 10, verbose = TRUE)
96e22bfc
 }
 \arguments{
a6b3c979
 \item{graph}{A weighted igraph object. Weights must be in \code{edge.weights} or \code{weight}
 edge attributes.}
96e22bfc
 
a6b3c979
 \item{max.path.length}{The maxmimum path length.}
96e22bfc
 
a6b3c979
 \item{num.samples}{The numner of paths to sample}
96e22bfc
 
a6b3c979
 \item{num.warmup}{The number of warm up paths to sample.}
96e22bfc
 
a6b3c979
 \item{verbose}{Whether to display the progress of the function.}
96e22bfc
 }
 \value{
a6b3c979
 A matrix where each row is a path length and each column is the number of paths sampled.
96e22bfc
 }
 \description{
087265c8
 Randomly traverses paths of increasing lengths within a set network to create an
a6b3c979
 empirical pathway distribution for more accurate determination of path significance.
96e22bfc
 }
 \details{
 Can take a bit of time.
 }
 \examples{
2aadfaf5
 	## Prepare a weighted reaction network.
96e22bfc
 	## 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,
087265c8
 		weight.method = "cor", use.attr="miriam.uniprot",
96e22bfc
 		y=factor(colnames(ex_microarray)), bootstrap = FALSE)
087265c8
 
96e22bfc
 	## Get significantly correlated paths using "p-valvue" method.
087265c8
 	##   First, establish path score distribution by calling "samplePaths"
96e22bfc
  pathsample <- samplePaths(rgraph, max.path.length=10,
                         num.samples=100, num.warmup=10)
087265c8
 
 	##   Get all significant paths with p<0.1
 	significant.p <- pathRanker(rgraph, method = "pvalue",
96e22bfc
                 sampledpaths = pathsample ,alpha=0.1)
2aadfaf5
 
96e22bfc
 }
 \seealso{
2aadfaf5
 Other Path ranking methods: \code{\link{extractPathNetwork}},
   \code{\link{getPathsAsEIDs}}, \code{\link{pathRanker}}
96e22bfc
 }
087265c8
 \author{
 Timothy Hancock
96e22bfc
 
087265c8
 Ahmed Mohamed
 }
 \concept{Path ranking methods}