View source: R/poolne_estim_input.R
poolne_estim_input | R Documentation |
poolne_estim
This function prepares biallelic SNP data for analysis by the programme poolne_estim
.
poolne_estim_input(
dat,
pool.info,
runID,
mcmc.sampling = c(1000, 25, 5000, 20, 50, sample(as.integer(1000:9999), 1))
)
dat |
Data table: The biallelic SNP data. Requires all of the following columns:
|
pool.info |
Data table: The population pool metadata. Requires all of the following columns:
|
runID |
Character: Appended inside filename to indicate a particular run or sim identifier. |
mcmc.sampling |
A vector MCMC sampling parameters for poolne_estim. Can be customised, but the
can be left alone (these are the defaults in
|
Four files are written to the working directory:
[runID]_[poolID]_Ref.txt
= Counts of Ref alleles; loci in rows, sample replicates in columns.
[runID]_[poolID]_Dep.txt
= Depth of reads; loci in rows, sample replicates in columns.
[runID]_[poolID]_Loci.txt
= A list of loci in the order they appear in the count TXT files.
[runID]_[poolID]_Input.txt
= The params input file for poolne_estim
.
# Load in the pool metadata and reads
data(data_PoolInfo)
data(data_PoolReads)
# Have a look at the data: the samples are populations
# ('Pop') and replicate library preps ('Rep').
data_PoolReads$SAMPLE
# You need to make sure there is a column that contains
# the pool ID. Split the SAMPLE column and return the first value:
X <- data_PoolReads
X$POOL <- unlist(lapply(strsplit(X$SAMPLE, '_'), function(X){ return(X[1]) }))
# Check
X
# Now make inputs
poolne_estim_input(dat=X, pool.info=data_PoolInfo, runID='genomalicious')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.