Learn R Programming

Rsampletrees (version 0.1)

newArgs: Create or modify a sampletrees settings object

Description

Create or modify a settings object containing the arguments for a run of the C++ program sampletrees.

Usage

newArgs(...)
"changeArgs"(object,...)

Arguments

object
An object of class `pars'
...
Tags and the values they should be set to. A list of the tag names is given in the Value section

Value

Returns an object of class `pars' which is a list with elements:
RunName
Run name for the sampletrees run (Default="Run")
Seed
Initial seed for sampletrees run. (Default=NA)
DataType
The type of the data file g=genotype h=haplotype. (Default="h")
DataFile
The name of the file containing the haplotype or genotype data. DEFAULT=NA but the user must change this value before running sampletrees
LocationFile
The name of the file containing the genomic locations (in base pairs) of the SNP markers. Default=NA but the user must change this value before running sampletrees
WeightFile
The name of the file containing the probabilities for sampling each of the 7 updates. Default=NA but the user must change this value before running sampletrees. See setWeights for more information.
FocalPoint
The location of the focal point. Default=NA but the user must change this value before running sampletrees
ChainLength
How long to run the chain. (Default=1000)
BurnIn
Discard the first 'BurnIn' samples. (Default=100)
Thinning
Return output every 'Thinning'th sample. (Default=1)
InitialTheta
Initial value for mutation rate theta. (Default=1)
MinTheta
Minimum for Uniform prior for theta. (Default=0.0001)
MaxTheta
Maximum for Univorm prior for theta. (Default=10)
InitialRho
Initial value for recombination rate rho. (Default=0.0004)
ScaleRho
Scale parameter for gamma prior for rho. (Default=0.1)
ShapeRho
Shape parameter for gamma prior for rho. (Default=1)
InitialTreeFile
Name for a file containing initial tree data for a run of sampletrees. These are typically available from a previous run of sampletrees. If DataType="g", initial haplotype configurations will be taken from this file rather than one specified by InitialHaploFile. (Default=NA)
RandomTree
Indicates whether initial tree generated by randomly connecting nodes. (Default=FALSE)
HaploFreqFile
The name of the file with the haplo frequency estimates to be used only if DataType="g". See estimateHapFreqs() for more information. Default=NA but user must change this value if DataType is 'g'.
InitialHaploFile
Name for an optional file containing the initial haplotype configurations for the sampletrees run (optional if DataType="g"). Each row of this file corresponds to a haplotype, there are 2 rows/individual and rows must be in the same order as in DataFile. (Default=NA)
HaploListFile
Name for a optional file containing a list of likely haplotypes (optional if DataType="g"). Each row corresponds to a haplotype. (Default=NA)
clean
An indicator for whether the list passes the checks for a clean sampletrees run. In order to ensure no errors with sampletrees, the user should not modify this value and instead should run checkPars(). (Default=FALSE)

Details

The function newArgs() initializes a list object of class `pars' that contains the settings for a run of sampletrees. The user can optionally pass arguments to newArgs to change some of the settings from their default values. The format for passing arguments to newArgs is: TagName=Value. The allowable tag names and their default values for an object of type 'pars' are given below in the Value section.

The function changeArgs modifies the values in a settings object of class `pars'. The arguments are passed to changeArgs in same way as to newArgs.

Note that although both functions allow list elements to be set to default values, before running sampletrees the user will have to provide non-default values for some elements (DataFile, LocationFile, WeightFile, FocalPoint). Using non-default values is recommended for ChainLength/BurnIn/Thinning as the default values are set to ensure short test runs.

References

TBD

See Also

checkArgs

Examples

Run this code
runpars=newArgs(DataFile="sequences_Theta8_Rho8.txt", DataType="h", 
		LocationFile="locations_Theta8_Rho8.txt",RunName="Test-h",FocalPoint=10000)
runpars=changeArgs(runpars, Seed=1938474, WeightFile="weights-h.txt")

Run the code above in your browser using DataLab