runBorealis: Run the full borealis pipeline

View source: R/outlier.R

runBorealisR Documentation

Run the full borealis pipeline

Description

Run the full borealis pipeline. It will load in bismark data and save out to disk matrix-based methylation and total count files, then it will build the beta-binomial statistical models for the cohort at each CpG site and save the parameters of this model to disk, and finally provide outlier p-values and summary statistics for each sample in the cohort at each CpG site.

Usage

runBorealis(inDir,
            suffix ="_merged.cov.gz.CpG_report.merged_CpG_evidence.cov.gz",
            nThreads = 8, minDepth = 4, minSamps = 5, timeout = 10,
            laplaceSmooth = TRUE,
            chrs = c(paste0("chr",seq_len(22)), "chrX", "chrY"),
            outprefix = "borealis_", modelOutPrefix = "CpG_model")

Arguments

inDir

character(1) Directory path to bismark results. NOTE: this assumes following pattern for full paths to bismark coverage gz files: ${inDir}/${sampleName}/${sampleName}${suffix}

suffix

(optional) character(1) File suffix for the bismark coverage files.

nThreads

(optional) numeric(1) Number of compute threads to be used in multithreading computations.

minDepth

(optional) numeric(1) The minimum depth of coverage for sample to go into modeling.

minSamps

(optional) numeric(1) The minimum number of samples with minDepth coverage required to build a model at a given CpG site.

timeout

(optional) numeric(1) The maximum time in seconds to spend trying to build a model at a given CpG site (if it takes longer, we skip the site).

laplaceSmooth

(optional) logical(1) Whether or not to do Laplace (i.e., add one) smoothing on the counts.

chrs

(optional) A character vector listing the chromosomes to be loaded.

outprefix

(optional) character(1) The sample output file prefix (can include a full file path if current working directory is not desired output location).

modelOutPrefix

(optional) character(1) The cohort modeling output file prefix (can include a full file path if current working directory is not desired output location).

Value

Returns an object of "BSseq" class with raw dataset loaded and used for modeling purposes.

Examples

extdata <- system.file("extdata","bismark", package="borealis")
outdir <- tempdir()
results <- runBorealis(extdata,nThreads=2,chrs="chr14",suffix=".gz",
                        outprefix = file.path(outdir,"borealis_"),
                        modelOutPrefix = file.path(outdir,"CpG_model"))

GarrettJenkinson/borealis documentation built on Jan. 1, 2023, 6:16 a.m.