#' Initialize a population of \code{PrixFixeNetwork}s
#'
#' Given a \code{PFData} object, generate a random population of \code{PrixFixeNetwork}
#' objects of size \code{population_size}.
#'
#' @param pf_data a \code{PFData} object generated by \code{PFDataLoader}
#' @param population_size The number of networks to generate for the population.
#' @param members a character string of either \code{true_members} or \code{null_members}.
#' @param binary boolean for whether to get binary (TRUE) or weighted (FALSE) adjacency matrix.
#' @return A list of size \code{population_size} containing \code{PrixFixeNetwork} objects.
#'
#' @examples
#' \dontrun{
#' #' # load example PFData (FA genes)
#' data(PF_FanconiAnemia)
#' # generate population of subnetworks
#' population <- initializePopulation(PF_FanconiAnemia, population_size=100, "true_members")
#' }
#'
initializePopulation <- function(pf_data,
population_size,
members = c("true_members", "null_members"),
binary = TRUE) {
dopar_progress_bar <- make_progress_bar(population_size)
population <- foreach (i=1:population_size,
.combine = dopar_progress_bar()) %dopar% {
return(constructCandidateNetwork(pf_data, members, binary))
}
return(population)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.