FilterByConversionRate: Calculate reads conversion rate

View source: R/context_methylation_functions.r

FilterByConversionRateR Documentation

Calculate reads conversion rate

Description

Calculate reads conversion rate

Usage

FilterByConversionRate(MethSM, chr, genome, thr = 0.2)

Arguments

MethSM

as comes out of the func GetSingleMolMethMat

chr

Chromosome, MethSM doesn't carry this info

genome

BSgenome

thr

Double between 0 and 1. Threshold above which to filter reads. Defaults to 0.2

Value

Filtered MethSM

Examples

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

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

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

    MethSM = GetSingleMolMethMat(QuasRprj, range, sample)
    MethSM = FilterByConversionRate(MethSM, chr = "chr6", genome = BSgenome.Mmusculus.UCSC.mm10, thr = 0.8)
}


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