View source: R/Get_and_Filter_CpGs.R
getCpGs | R Documentation |
getCpGs()
reads individual sample Bismark CpG reports into a single
BSseq object and then saves it as a .rds file.
getCpGs(
colData,
path = getwd(),
pattern = "*CpG_report.txt.gz",
sameLoci = TRUE,
chroms = c(paste("chr", 1:22, sep = ""), "chrX", "chrY", "chrM"),
BPPARAM = BiocParallel::MulticoreParam(10),
save = TRUE,
file = "Unfiltered_BSseq.rds",
verbose = TRUE
)
colData |
A |
path |
A |
pattern |
A regular expression used to filter for CpG reports. |
sameLoci |
A |
chroms |
A |
BPPARAM |
A BiocParallel::BiocParallelParam instance providing the parallel back-end to use during evaluation. |
save |
A |
file |
A |
verbose |
A |
This BSseq object still needs to be filtered for
coverage at individual CpGs. More information on these arguments is given in
the documentation for bsseq::read.bismark()
.
A BSseq object.
getCpGtotals()
and plotCpGtotals()
for help with deciding
coverage cutoffs.
filterCpGs()
to filter the BSseq object.
bsseq::read.bismark()
for more details on the arguments and
the underlying functions.
## Not run:
# Read Bismark CpG Reports
colData <- read.xlsx("sample_info.xlsx", rowNames = TRUE)
bs <- getCpGs(colData, file = "Unfiltered_BSseq.rds")
# Examine CpG Totals at Different Cutoffs
CpGtotals <- getCpGtotals(bs, file = "CpG_Totals.txt")
plotCpGtotals(CpGtotals, file = "CpG_Totals.pdf")
# Filter BSseq Object
bs <- filterCpGs(bs, cov = 2, perSample = 0.75, file = "Filtered_BSseq.rds")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.