Learn R Programming

PopGenome (version 2.1.6)

sweeps.stats-methods: Selective Sweeps

Description

This module calculates some statistics to detect selective sweeps.

Usage

## S3 method for class 'GENOME':
sweeps.stats(object,new.populations=FALSE,subsites=FALSE,
 freq.table=FALSE, FST=FALSE)
## S3 method for class 'GENOME':
get.sweeps(object)

Arguments

object
an object of class "GENOME"
new.populations
list of populations. default:FALSE
subsites
"transitions": SNPs that are transitions. "transversions": SNPs that are transversions. "syn": synonymous sites. "nonsyn": non-synonymous sites. "exon": SNPs in exon regions. "in
freq.table
the frequency counts for the CLR test. "list"
FST
use FST values instead of the minor allele frequencies

Value

  • The return value is a modified object of class "GENOME" -------------------------------------------------------------- The following slots will be modified in the "GENOME" object --------------------------------------------------------------
  • CLComposite Likelihood of SNPs
  • CLRNielsen's CLR test

Details

The freq.table contains the global sets of frequency counts. It can be produced with the module detail.stats. The values in the slot GENOME.class@region.stats@minor.allele.frequencies can be used to create this global set. (use the R function table) freq.table is a list of length n.pops.

References

Cai JJ (2008) PGEToolbox: A Matlab toolbox for population genetics and evolution Journal of Heredity Jul-Aug;99(4):438-40.doi:10.1093/jhered/esm127 Nielson, R. (2005). Genomic scans for selective sweeps using SNP data Genome Res. 2005 15: 1566-1575

Examples

Run this code
# Reading one alignment stored in the folder Aln
# GENOME.class <- readData("\home\Aln")
#
# CL
# GENOME.class <- sweeps.stats(GENOME.class)
# GENOME.class@CL
#
# CLR
# create global set
# GENOME.class  <- detail.stats(GENOME.class)
# freq <- GENOME.class@region.stats@minor.allele.freqs[[1]]
# freq.table <- list()
# freq.table[[1]] <- table(freq)
# define the region of interest
# GENOME.class.split <- splitting.data(GENOME.class, positions= ...)
# calculate CLR
# GENOME.class.split <- sweeps.stats(GENOME.class.split, freq.table=freq.table)
# GENOME.class@CLR

Run the code above in your browser using DataLab