Title: | Bisulfite-seq OutlieR mEthylation At singLe-sIte reSolution |
---|---|
Description: | Borealis is an R library performing outlier analysis for count-based bisulfite sequencing data. It detectes outlier methylated CpG sites from bisulfite sequencing (BS-seq). The core of Borealis is modeling Beta-Binomial distributions. This can be useful for rare disease diagnoses. |
Authors: | Garrett Jenkinson [aut, cre] |
Maintainer: | Garrett Jenkinson <[email protected]> |
License: | GPL-3 |
Version: | 1.11.0 |
Built: | 2024-10-30 04:28:27 UTC |
Source: | https://github.com/bioc/borealis |
Borealis is an R package performing outlier analysis for count-based bisulfite sequencing data. It detectes outlier methylated CpG sites from bisulfite sequencing (BS-seq). The core of Borealis is modeling Beta-Binomial distributions. This can be useful for rare disease diagnoses.
See packageDescription('borealis')
Maintainer: Garrett Jenkinson <[email protected]>
Generate plots of model and results. The top panel of the plot will be the beta distribution in the beta-binomial model estimated for the cohort. The bottom panel will be the 95 percent confidence intervals around the percent methylation in each sample at that CpG site.
plotCpGsite(cpgSites, sampleOfInterest=NA, modelFile="CpG_model.csv", methCountFile="CpG_model_rawMethCount.tsv", totalCountFile="CpG_model_rawTotalCount.tsv")
plotCpGsite(cpgSites, sampleOfInterest=NA, modelFile="CpG_model.csv", methCountFile="CpG_model_rawMethCount.tsv", totalCountFile="CpG_model_rawTotalCount.tsv")
cpgSites |
A character vector of CpG sites specified as "chr1:71732" representing the chromosome and start position of the CpG site. A separate plot will be generated for each site specified. |
sampleOfInterest |
(optional) |
modelFile |
|
methCountFile |
|
totalCountFile |
|
Returns a list
with each element indexed by the provided cpgSites
and storing a ggplot/cowplot object.
extdata <- system.file("extdata", package="borealis") plots <- plotCpGsite("chr14:24780288", sampleOfInterest="patient_72", modelFile=file.path(extdata,"CpG_model_chr14.csv"), methCountFile=file.path(extdata,"CpG_model_rawMethCount_chr14.tsv"), totalCountFile=file.path(extdata,"CpG_model_rawTotalCount_chr14.tsv"))
extdata <- system.file("extdata", package="borealis") plots <- plotCpGsite("chr14:24780288", sampleOfInterest="patient_72", modelFile=file.path(extdata,"CpG_model_chr14.csv"), methCountFile=file.path(extdata,"CpG_model_rawMethCount_chr14.tsv"), totalCountFile=file.path(extdata,"CpG_model_rawTotalCount_chr14.tsv"))
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.
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")
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")
inDir |
|
suffix |
(optional) |
nThreads |
(optional) |
minDepth |
(optional) |
minSamps |
(optional) |
timeout |
(optional) |
laplaceSmooth |
(optional) |
chrs |
(optional) A character vector listing the chromosomes to be loaded. |
outprefix |
(optional) |
modelOutPrefix |
(optional) |
Returns an object of "BSseq" class with raw dataset loaded and used for modeling purposes.
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"))
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"))
Run a single new sample after modeling using runBorealis
has already
been completed in a cohort of samples. It will not rebuild the models and only
predict using previously estimated model specified by modelFile
.
runSingleNewSample(inFile, outFile, minObsDepth=10, modelFile="CpG_model.csv")
runSingleNewSample(inFile, outFile, minObsDepth=10, modelFile="CpG_model.csv")
inFile |
|
outFile |
|
minObsDepth |
(optional) |
modelFile |
(optional) |
Returns a GRanges
object with modeling results.
extdata <- system.file("extdata", package="borealis") outdir <- tempdir() gr <- runSingleNewSample(file.path(extdata,'bismark','patient_72', 'patient_72.gz'),file.path(outdir,'output.txt'), modelFile=file.path(extdata,'CpG_model_chr14.csv'))
extdata <- system.file("extdata", package="borealis") outdir <- tempdir() gr <- runSingleNewSample(file.path(extdata,'bismark','patient_72', 'patient_72.gz'),file.path(outdir,'output.txt'), modelFile=file.path(extdata,'CpG_model_chr14.csv'))