Learn R Programming

poolABC

The goal of poolABC is to help users perform model choice and parameter inference using Pool-seq data integrated into an Approximate Bayesian Computation (ABC) framework. This package provides functions to simulate Pool-seq data under models of ecotype formation and to import Pool-seq data from real populations. Two ABC algorithms are implemented to perform parameter estimation and model selection using Pool-seq data. Cross-validation can also be performed to assess the accuracy of ABC estimates and calculate model misclassification.

Installation

You can install the development version of poolABC from GitHub with:

# install.packages("devtools")
devtools::install_github("joao-mcarvalho/poolABC")

Alternatively, you can install the current stable version of poolABC from CRAN:

install.packages("poolABC")

Copy Link

Version

Install

install.packages('poolABC')

Monthly Downloads

177

Version

1.0.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

João Carvalho

Last Published

August 8th, 2023

Functions in poolABC (1.0.0)

Het_Between

Compute heterozygosity between all pairs of populations
cmdSingle

Create SCRM command line for a single origin scenario
cmd2pops

Create SCRM command line for a model with two populations
errorABC

Calculate cross-validation prediction error of parameter estimation
cmdParallel

Create SCRM command line for a parallel origin scenario
cleanData

Import and clean a single file containing data in popoolation2 format
checkMissing

Remove sites with missing data
checkMajor

Check if the major allele is the same in all populations
error_modelSel

Compute error in model selection with Approximate Bayesian Computation
createHeader

Create a header for a _rc file of popoolation2
index.rejABC

Parameter estimation with Approximate Bayesian Computation using rejection sampling and recording just the index of accepted simulations
importContigs

Import multiple files containing data in PoPoolation2 format
filterData

Filter the data by the frequency of the minor allele
getmode

Calculate the mode of a distribution
importData

Import a single file containing data in popoolation2 format
exclusive

Compute the fraction of exclusive sites
fixed

Compute the fraction of sites fixed between populations
euclidean

Compute euclidean distance
forceLocus

Force the simulations to contain the required number of loci
createParams

Draw parameters from the priors
getFst

Calculate FST
indexSNPs

Obtain the index of SNPs inside a block with defined size
mergepost

Merge posterior distributions
limits

Matrix of prior limits
myparams

Matrix of simulated parameter values
meanExpected_Het

Compute mean expected heterozygosity within a population
normalise

Normalize data - adjust values measured on different scales
mode_locfit

Compute mode of a locfit object
multipleABC

Parameter estimation with Approximate Bayesian Computation for multiple targets
modelSelect

Perform model selection with Approximate Bayesian Computation
organize.poststat

Organize point estimates from multiple posterior distributions
pickWindows

Randomly select blocks of a given size from several contigs
pairFST

Pairwise FST among populations
organizeSCRM

Organize scrm output
plot_Posteriors

Plot multiple posterior distributions
params

Matrix of simulated parameter values
plot_error

Prediction error plots for ABC
plot_errorABC

Prediction error plots for ABC using a list
inverse_trans

Back-transform the parameters values
plot_param

Plot the density estimation of a given parameter
plot_msel

Plot model misclassification
prepareData

Organize information by contig - for multiple data files
plot_stats

Plot the fit of a summary statistic to the target
prepareFile

Organize information by contigs - for a single data file
priorsMatrix

Construct matrix of prior limits
poststat

Calculate point estimates from the posterior distribution
poolSim

Simulation of Pooled DNA sequencing
plot_weighted

Plot the density estimation of a given parameter
popsFST

Pairwise FST among populations and across multiple loci
poolStats

Compute summary statistics from Pooled DNA sequencing
rc1

Data frame with an example of observed data
remove_quantileReads

Remove sites using quantiles of the depth of coverage
scaledPrior

Compute scaled migration rate limits
remove_realReads

Remove sites, according to their coverage, from real data
shared

Compute the fraction of sites shared between populations
rejABC

Parameter estimation with Approximate Bayesian Computation using rejection sampling
removeVar

Remove columns with zero variance
regABC

Parameter estimation with Approximate Bayesian Computation using local linear regression
rc2

Data frame with an example of observed data
scaled.migration

Compute scaled migration rates
runSCRM

Run scrm and obtain genotypes
statsContig

Compute summary statistics from observed data
sim_modelSel

Leave-one-out cross validation of model selection
singleABC

Parameter estimation with Approximate Bayesian Computation for a single target
simulationABC

Perform an Approximate Bayesian Computation simulation study
summary_modelSelect

Posterior model probabilities
sumstats

Matrix of summary statistics computed from simulated data
tranf

Apply a transformation to the parameters
weighted_stats

Compute weighted point estimates
ABC

Parameter estimation with Approximate Bayesian Computation with several targets
abba

Calculate the abba portion of the D-statistic
Expected_Het

Compute expected heterozygosity within a population
D.statPool

Perform D-statistics analysis
D.stat

calculate D-statistic
Tmatrix

Transform matrix of parameter values
BTmatrix

Back-transform matrix of parameter values
baba

Calculate the baba portion of the D-statistic
checkCoverage

Remove sites with incorrect depths of coverage