Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

derfinder (version 1.6.4)

sampleDepth: Calculate adjustments for library size

Description

For a given data set calculate the per-sample coverage adjustments. Hector Corrada's group proposed calculating the sum of the coverage for genes below a given sample quantile. In this function, we calculate the sample quantiles of interest by sample, and then the sum of the coverage for bases below or equal to quantiles of interest. The resulting values are transformed {log2(x + scalefac)} to avoid very large numbers that could potentially affect the stability of the F-statistics calculation. The sample coverage adjustments are then used in makeModels for constructing the null and alternative models.

Usage

sampleDepth(collapsedFull, probs = c(0.5, 1), scalefac = 32, ...)

Arguments

collapsedFull
The full coverage data collapsed by sample as produced by collapseFullCoverage.
probs
Number(s) between 0 and 1 representing the quantile(s) of interest. For example, 0.5 is the median.
scalefac
Number added to the sample coverage adjustments before the log2 transformation.
...
Arguments passed to other methods and/or advanced arguments.

Value

  • A matrix (vector of length(probs) == 1) with the library size depth adjustments per sample to be used in makeModels. The number of rows corresponds to the number of quantiles used for the sample adjustments.

References

Paulson, J. N., Stine, O. C., Bravo, H. C. & Pop, M. Differential abundance analysis for microbial marker-gene surveys. Nat. Methods (2013). doi:10.1038/nmeth.2658

See Also

collapseFullCoverage, makeModels

Examples

Run this code
## Collapse the coverage information
collapsedFull <- collapseFullCoverage(list(genomeData$coverage), 
    verbose=TRUE)

## Calculate library size adjustments
sampleDepths <- sampleDepth(collapsedFull, probs=c(0.5, 1), verbose=TRUE)
sampleDepths

Run the code above in your browser using DataLab