Learn R Programming

PopGenome (version 2.7.2)

MS: Coalescent simulation with or without selection

Description

This function uses Hudson's MS and Ewing's MSMS to compare simulated data with the observed data.

Usage

MS(GENO,niter=10,thetaID="user",params=FALSE,detail=FALSE,
neutrality=FALSE,linkage=FALSE,F_ST=FALSE,MSMS=FALSE,big.data=FALSE)

Arguments

GENO

an object of class "GENOME"

niter

number of samples per locus

thetaID

"Tajima","Watterson" or "user". default:"user"

neutrality

Calculate neutrality tests. default=FALSE

linkage

Calculate linkage disequilibrium. default=FALSE

F_ST

Calculate fixation index. default=FALSE

params

an object of class "test.params". see ?test.params

detail

detailed statistics. Note: slower computations! default=FALSE

MSMS

specify parameter for MSMS simulation with selection (has to be specified as a string)

big.data

if TRUE the ff-package is used

Value

The function creates an object of class "cs.stats"

Details

You can choose different mutation rate estimators to generate simulation data. When thetaID="user", you have to define the theta values in an object of class "test.params". The "test.params" class can also be used to specify some additional parameter like migration and/or recombination rates... (?test.params).

Please read the MSMS documentation for the correct use of coalescent simulations to assess statistical significance.

References

Hudson, R. R. (2002). Generating samples under a Wright-Fisher neutral model of genetic variation. Bioinformatics 18: 337-338

Gregory Ewing and Joachim Hermisson, MSMS: A Coalescent Simulation Program Including Recombination, Demographic Structure, and Selection at a Single Locus. Bioinformatics 2010, doi: 10.1093/bioinformatics/btq322

Examples

Run this code
# NOT RUN {
# GENOME.class <- readData("...\Alignments")
# GENOME.class <- neutrality.stats(GENOME.class,list(1:6))
# MS.class <- MS(GENOME.class,thetaID="Tajima",neutrality=TRUE)
# MS.class <- MS(GENOME.class,thetaID="Tajima",neutrality=TRUE,
#                MSMS="-N 1000 -SAA 200 -SaA 100 -SF 1e-2")
# MS.class
# MS.class@obs.val
# MS.class@locus[[1]] 

# }

Run the code above in your browser using DataLab