Description Usage Arguments Value Author(s) See Also Examples
View source: R/calculateStats.R
After defining the models of interest (see makeModels) and pre-processing the data (see preprocessCoverage), use calculateStats to calculate the F-statistics at base-pair resolution.
1 | calculateStats(coveragePrep, models, lowMemDir = NULL, ...)
|
coveragePrep |
A list with |
models |
A list with |
lowMemDir |
The directory where the processed chunks are saved when
using preprocessCoverage with a specified |
... |
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
Passed to define_cluster. |
A numeric Rle with the F-statistics per base pair that passed the cutoff.
Leonardo Collado-Torres
makeModels, preprocessCoverage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Collapse the coverage information
collapsedFull <- collapseFullCoverage(list(genomeData$coverage),
verbose = TRUE
)
## Calculate library size adjustments
sampleDepths <- sampleDepth(collapsedFull, probs = c(0.5), verbose = TRUE)
## Build the models
group <- genomeInfo$pop
adjustvars <- data.frame(genomeInfo$gender)
models <- makeModels(sampleDepths, testvars = group, adjustvars = adjustvars)
## Preprocess the data
prep <- preprocessCoverage(genomeData,
cutoff = 0, scalefac = 32,
chunksize = 1e3, colsubset = NULL
)
## Run the function
fstats <- calculateStats(prep, models, verbose = TRUE, method = "regular")
fstats
## Not run:
## Compare vs pre-packaged F-statistics
library("testthat")
expect_that(fstats, is_equivalent_to(genomeFstats))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.