UnmixRawCounts: Given a mixing fraction w, two probability vectors, split...

View source: R/scChIX.R

UnmixRawCountsR Documentation

Given a mixing fraction w, two probability vectors, split counts from double-incubated reads into their respective histone modification.

Description

Given a mixing fraction w, two probability vectors, split counts from double-incubated reads into their respective histone modification.

Usage

UnmixRawCounts(x.raw, mixweight, p.active, p.repress, random.seed = 0)

Arguments

x.raw

vector of raw counts from a double-incubated cell.

mixweight

mixing fraction of the two histone modifications, relative to a reference histone modification (usually p.active)

p.active

probability vector across genomic bins for reference histone modification. ie probability a sampled read from reference histone modification falls on specific genomic locus.

p.repress

probability vector across genomic bins for non-reference histone modification. ie probability a sampled read from non-reference histone modification falls on specific genomic locus.

random.seed

random seed for reproducibility

Value

list: x.raw.active: a vector of counts assigned to reference histone mark. x.raw.repress: a vector of counts assigned to non-ref histone mark, p.cell.active.weights: parameter used to specify the binomial distirbution for splitting reads.

Examples

x.raw.unmixed <- lapply(all.cells, function(jcell){
  # print(jcell)
  return(UnmixRawCounts(x.raw = all.x.raw[[jcell]], mixweight = all.mixweights[[jcell]], p.active = all.p.active[[jcell]], p.repress = all.p.repress[[jcell]], random.seed = 0))
})
)

jakeyeung/scChIX documentation built on May 7, 2023, 9:14 a.m.