View source: R/poolfstat_DT2Fst.R
poolfstat_DT2Fst | R Documentation |
poolfstat
from a data table of read countsTakes a data table of read counts and creates an object of class
poolfstat
. The FST for the pools in the data table is calculated using
the function poolfstat::computeFST
. Also requires pool size information.
poolfstat_DT2Fst(dat, pool.info, method = "Anova")
dat |
Data table: Contains read counts, e.g. like that been
produced by the function
|
pool.info |
Data table: Contains the sample sample sizes (number of diploids) for
for each unique pool listed in
|
method |
Character: Either 'Anova' (default) or 'Identity'. Passed to |
Returns a list with two indices: $Fst
is the calculated FST among the
pools using a function call of poolfstat::computeFST
, whereas $pooldat
is the
poolfstat
object used to generate said FST values.
library(genomalicious)
# Load in the pool metadata and reads
data(data_PoolInfo)
data(data_PoolFreqs)
# Pool info
data_PoolInfo
# Pool reads in $DP, $AO, and $RO
data_PoolFreqs[, c('POOL','DP','AO','RO')]
# Calculate FST using poolfstat
Y <- poolfstat_DT2Fst(data_PoolFreqs, data_PoolInfo)
# Output is a list
class(Y)
# Outout from poolfstat::computeFST
Y$Fst
# The pooldata class object, generated from data table of pooled reads
class(Y$pooldat)
Y$pooldat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.