FilterContextCytosines: Filter Cytosines in context

View source: R/context_methylation_functions.r

FilterContextCytosinesR Documentation

Filter Cytosines in context

Description

Filter Cytosines in context

Usage

FilterContextCytosines(MethGR, genome, context)

Arguments

MethGR

Granges obj of average methylation

genome

BSgenome

context

Context of interest (e.g. "GC", "CG",..)

Value

filtered Granges obj

Examples

Qinput = paste0(tempdir(), "/NRF1Pair_Qinput.txt")
library(BSgenome.Mmusculus.UCSC.mm10)

if(file.exists(Qinput)){
    QuasRprj = GetQuasRprj(Qinput, BSgenome.Mmusculus.UCSC.mm10)

    Samples = readr::read_delim(Qinput, delim = "\t")$SampleName
    sample = Samples[1]
    range = GRanges(seqnames = "chr6", ranges = IRanges(start = 88106000, end = 88106500), strand = "*")

    MethGR = QuasR::qMeth(QuasRprj[grep(sample, Samples)], mode="allC", range, collapseBySample = TRUE, keepZero = TRUE)
    FilterContextCytosines(MethGR, BSgenome.Mmusculus.UCSC.mm10, "NGCNN")
}


Krebslabrep/SingleMoleculeFootprinting documentation built on Nov. 19, 2022, 3:56 a.m.