Learn R Programming

BAMMtools (version 2.1.12)

generateControlFile: Generate control file for BAMM

Description

Generates a template diversification or trait control file for BAMM, while allowing the user to specify parameter values.

Usage

generateControlFile(
  file = "controlfile.txt",
  type = "diversification",
  params = NULL
)

Arguments

file

Destination file name with or without path.

type

Character, either “diversification” or “trait”, depending on the desired BAMM analysis.

params

List of parameters, see Details.

Author

Pascal Title

Details

The user can supply parameters as a list, where the name of the list item is the name of the parameter as it appears in the control file, and the value of the list item is what will be placed in the contol file.

If a parameter is specified by the user, it will automatically be uncommented if it was commented in the template.

References

http://bamm-project.org/

Examples

Run this code
if (FALSE) {
#Produce a blank template control file
generateControlFile(file = 'traitcontrol.txt', type='trait')

#Produce a customized control file
data(whales)

#get bamm priors to supply to control file
priors <- setBAMMpriors(whales, outfile = NULL)

generateControlFile(file = 'divcontrol.txt', params = list(
    treefile = 'whales.tre',
    globalSamplingFraction = '1',
    numberOfGenerations = '100000',
    overwrite = '1',
    lambdaInitPrior = as.numeric(priors['lambdaInitPrior']),
    lambdaShiftPrior = as.numeric(priors['lambdaShiftPrior']),
    muInitPrior = as.numeric(priors['muInitPrior']),
    expectedNumberOfShifts = '1'))
}

Run the code above in your browser using DataLab