R/RcppExports.R

Defines functions generateStartK generateKSamples callFunction countKs run_simulation_cpp

Documented in countKs generateKSamples generateStartK run_simulation_cpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Draws a single starting immune value from a cumulative vector distribution
#'
#' @param dist the vector of K values to draw from.
#' @return A single K value from the given distribution
#' @export
#' @useDynLib driftSim
#' @seealso \code{\link{generateKSamples}}
generateStartK <- function(dist) {
    .Call('_driftSim_generateStartK', PACKAGE = 'driftSim', dist)
}

#' Generate N samples of immune values (K)
#' 
#' @param cumSumK the cumulative distribution of K frequencies
#' @param N the number samples to draw
#' @return A random sample of N K values from cumSumK
#' @export
#' @useDynLib driftSim
#' @seealso \code{\link{generateStartK}}
generateKSamples <- function(cumSumK, N) {
    .Call('_driftSim_generateKSamples', PACKAGE = 'driftSim', cumSumK, N)
}

#' @export
#' @useDynLib driftSim
callFunction <- function(filename, N, f) {
    .Call('_driftSim_callFunction', PACKAGE = 'driftSim', filename, N, f)
}

#' Counts Ks
#'
#' Counts the number of individuals in the host population with each K value from 0 to N
#' @param ks the vector of K values
#' @param N the maximum K value to count
#' @return a vector of length N with K counts
#' @export
#' @useDynLib driftSim
countKs <- function(ks, N) {
    .Call('_driftSim_countKs', PACKAGE = 'driftSim', ks, N)
}

#' Interface to the entire C++ driftSim simulation
#'
#' @param flags set of boolean flags for simulation output. See \code{\link{run_simulation}}
#' @param hostPopn vector of parameters related to the host population. See \code{\link{run_simulation}}
#' @param virusPars vector of parameters related to the influenza virions. See \code{\link{run_simulation}}
#' @param deltaVMat matrix of gradients for use in simulating adaptive binding avidity.
#' @param iniKs data frame of initial K values
#' @param day integer of simulation starting day
#' @param final_day integer of simulation final day (steps of 1 day)
#' @param input_files vector of input file names, as in \code{\link{run_simulation}}
#' @param output_files vector of output file names, as in \code{\link{run_simulation}}
#' @param VERBOSE boolean to indicate how much console output the simulation should have
#' @param scenario integer 1 to 4, indicating which version of the model is being run. See \code{\link{scenario_descriptions}} for a description of each scenario
#' @param callback pointer to enable call backs to R. Pretty much just for progress bar in the shiny app
#' @return the final virus ID from the simulation
#' @export
#' @useDynLib driftSim
run_simulation_cpp <- function(flags, hostPopn, virusPars, deltaVMat, iniKs, day, final_day, input_files, output_files, VERBOSE, scenario, callback) {
    .Call('_driftSim_run_simulation_cpp', PACKAGE = 'driftSim', flags, hostPopn, virusPars, deltaVMat, iniKs, day, final_day, input_files, output_files, VERBOSE, scenario, callback)
}
jameshay218/driftSim documentation built on Jan. 24, 2020, 6:14 p.m.