Generate control file for BAMM

Share:

Description

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

Usage

1
2
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.

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.

Author(s)

Pascal Title

References

http://bamm-project.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#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'))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.