ABC_simulation_uniform: Do ABC simulation with a configuration table and uniform...

Description Usage Arguments Details Value

View source: R/ABC_simulation_uniform.R

Description

A function for doing abc simulation with a configuration table and uniform prior on the number of co-expansion events. see Readme on github for required columns in the table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ABC_simulation_uniform(
  npod,
  conf,
  time.range,
  buffer = 0,
  prefix = "temp",
  BayeSSCallocation,
  do.parallel = 1,
  write.reference.file = F
)

Arguments

npod

An integer, the number of simulation replicates

conf

A data frame with configurations

time.range

A vector containing two numeric elements specifying the minimal and maximum event time.

buffer

The minimal amount of time separating two events. The default is 0, when events' time are sampled randomly

prefix

BayeSSC will generate many intermediate files, this function will create temporary folders for storing these files. One folder for one row in the configuration table, and the folders are named as prefixsimulation replicates_row number.If folders with the same name already exist, user will be prompt for providing another prefix or overwriting the folders.

BayeSSCallocation

A character string providing the location of the BayeSSC executable (including the file name)

do.parallel

A integer for the number of parallel threads to use. if equals 1,no parallel execution. The parallel R package required

write.reference.file

TRUE or FALSE(Default). If TRUE, the simulated hyperstat will be append to a file prefix_reference_table. Useful for running large number of replicates.If False, the simulated hyperstat will be collected and returned as a data frame

Details

For the prior on the number of co-expansion events, this function offers users a choice to use a uniform distribution as applied hBayeSSC

Value

If write.reference.file is FALSE, this function returns a data frame containing the simulated hyperstats. The first column is 'uid' (prefix+the replicates number), the second column is the number of events, and the third column is the total number of species. Following are columns of the "real" expansion time for each species in the simulation, and then, the columns of hyperstats.If write.reference.file is TRUE, this function returns a character string providing the path to the reference file.


huatengh/CoExpansionValidation documentation built on Nov. 19, 2021, 11:07 a.m.