Learn R Programming

Rsampletrees (version 0.1)

checkArgs: Error checking for the arguments to sampletrees

Description

This function is used to check the arguments to be used for a run of sampletrees. If the options are properly specified, then sampletrees can be expected to run without errors from improper input files.

Usage

checkArgs(args)

Arguments

args
An object of class `pars' with the arguments for the sampletrees run

Value

Returns an object of class 'pars' with the 'clean' variable set to TRUE if the arguments in `args' pass the error check and FALSE otherwise.

Details

Extensive checking is done, including:

- Non-default values have been provided for settings requiring user-specified values

- All input files exist

- All numeric settings are set to numeric values

- The format of the genotype and/or sequence files are correct

- The file with SNP locations contains only numeric values in increasing order, and that the number of locations matches the number of SNPs in the genotype/sequence file

- Focal point is set to a location in the region containing the SNPs

- Weights sum to 1 and the proposal indices are in the right range

References

TBD

Examples

Run this code

# Will produce error messages
runpars=newArgs()
runpars=checkArgs(runpars)

# Will not produce errors
datname=system.file("Examples/sequences_Theta8_Rho8.txt",package="Rsampletrees")
locname=system.file("Examples/locations_Theta8_Rho8.txt",package="Rsampletrees")
weightname=system.file("Examples/weights-h.txt", package="Rsampletrees")
runpars=newArgs(DataFile=datname, DataType="h", WeightFile=weightname,
		LocationFile=locname,RunName="Test-h",FocalPoint=10000)
runpars=checkArgs(runpars)

Run the code above in your browser using DataLab