Title: | Rcpp implementation of THE REAL McCOIL |
---|---|
Description: | Wrapper for THE REAL McCOIL in Rcpp. Becuase R is easieR. |
Authors: | OJ Watson |
Maintainer: | OJ Watson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.3.1 |
Built: | 2024-11-06 04:27:50 UTC |
Source: | https://github.com/OJWatson/McCOILR |
This function triggers the c code for the categorical method
McCOIL_categorical( data, maxCOI = 25, threshold_ind = 20, threshold_site = 20, totalrun = 10000, burnin = 1000, M0 = 15, e1 = 0.05, e2 = 0.05, err_method = 1, path = getwd(), output = "output.txt", thin = 1 )
McCOIL_categorical( data, maxCOI = 25, threshold_ind = 20, threshold_site = 20, totalrun = 10000, burnin = 1000, M0 = 15, e1 = 0.05, e2 = 0.05, err_method = 1, path = getwd(), output = "output.txt", thin = 1 )
data |
An R data frame of SNP calling information. Row names are names of samples and column names are names of assays. |
maxCOI |
Upper bound for COI. The default is 25. |
threshold_ind |
The minimum number of sites for a sample to be considered. The default is 20. |
threshold_site |
The minimum number of samples for a locus to be considered. The default is 20. |
totalrun |
The total number of MCMC iterations. The default is 10000. |
burnin |
The total number of burnin iterations. The default is 1000. |
M0 |
Initial COI. The default is 15. |
e1 |
The probability of calling heterozygous loci homozygous. The default is 0.05. |
e2 |
The probability of calling homozygous loci heterozygous. The default is 0.05. |
err_method |
The default is 1. 1: use pre-specified e1 and e2 and treat them as constants. 2: use likelihood-free sampling for e1 and e2; 3: e1 and e2 are estimated with COI and allele frequencies |
path |
The default is the current directory. |
output |
The name of output file. The default is output.txt. |
thin |
Numeric for how much the chain is thinned. Default = 1, means every iteration is written to file. If it was 0.1 then every 10th iteration is written to file |
return summary of output as data.frame
Categorical cpp code
McCOIL_categorical_cpp(paramList)
McCOIL_categorical_cpp(paramList)
paramList |
A list of parameters created with equivalent R function |
McCOIL_categorical_cpp
implements THE REAL McCOIL categorical method
This function triggers the c code for the proportional method
McCOIL_proportional( dataA1, dataA2, maxCOI = 25, totalrun = 10000, burnin = 1000, M0 = 15, epsilon = 0.02, err_method = 1, path = getwd(), output = "output.txt", thin = 1 )
McCOIL_proportional( dataA1, dataA2, maxCOI = 25, totalrun = 10000, burnin = 1000, M0 = 15, epsilon = 0.02, err_method = 1, path = getwd(), output = "output.txt", thin = 1 )
dataA1 |
The intensity of signals of allele 1 from the SNP assay. Row names are names of samples and column names are names of assays. |
dataA2 |
The intensity of signals of allele 2 from the SNP assay. Row names are names of samples and column names are names of assays. |
maxCOI |
Upper bound for COI. The default is 25. |
totalrun |
The total number of MCMC iterations. The default is 10000. |
burnin |
The total number of burnin iterations. The default is 1000. |
M0 |
Initial COI. The default is 15. |
epsilon |
The level of measurement error (eest). The default is 0.2. |
err_method |
The default is 1. 1: use pre-specified epsilon; 2: use likelihood-free sampling for epsilon; 3: update epsilon according to likelihood (for 2 and 3, pre-specified epsilon was used as initial value) |
path |
The default is the current directory. |
output |
The name of output file. The default is output.txt. |
thin |
Numeric for how much the chain is thinned. Default = 1, means every iteration is written to file. If it was 0.1 then every 10th iteration is written to file |
summary of output as data.frame
Proportional cpp code
McCOIL_proportional_cpp(paramList)
McCOIL_proportional_cpp(paramList)
paramList |
A list of parameters created with equivalent R function |
McCOIL_proportional_cpp
implements THE REAL McCOIL proportional method
Wrapper for THE REAL McCOIL in Rcpp, so that package can be more easily run on distributed computing services and cluster infrastructure.
Rcpp implementation of THE REAL McCOIL
1 Chang H-H, Worby CJ, Yeka A, Nankabirwa J, Kamya MR, Staedke SG, Dorsey G, Murphy M, Neafsey DE, Jeffreys AE, Hubbart C, Rockett KA, Amato R, Kwiatkowski DP, Buckee C, Greenhouse B. 2017. THE REAL McCOIL: A method for the concurrent estimation of the complexity of infection and SNP allele frequency for malaria parasites. PLOS Comput Biol 13: e1005348. doi:10.1371/journal.pcbi.1005348