PlotAvgSMF: Plot average methylation

View source: R/plot_single_molecule_examples.r

PlotAvgSMFR Documentation

Plot average methylation

Description

Plot average methylation

Usage

PlotAvgSMF(MethGR, range, TFBSs)

Arguments

MethGR

Average methylation GRanges obj

range

GRanges interval to plot

TFBSs

GRanges object of transcription factor binding sites to include in the plot. Assumed to be already subset.

Value

Average SMF signal at single site

Examples

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

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

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

    Methylation = CallContextMethylation(sampleSheet = Qinput,
                                     sample = MySample,
                                     genome = BSgenome.Mmusculus.UCSC.mm10,
                                     range = Region_of_interest,
                                     coverage = 20,
                                     ConvRate.thr = 0.2)

    TFBSs = GenomicRanges::GRanges("chr6", IRanges(c(88106253), c(88106263)), strand = "-")
    elementMetadata(TFBSs)$name = c("NRF1")
    names(TFBSs) = c(paste0("TFBS_", c(4305216)))

    PlotAvgSMF(MethGR = Methylation[[1]], range = Region_of_interest, TFBSs = TFBSs)
}


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