purify: The world's dumbest deconvolution function

View source: R/purify.R

purifyR Documentation

The world's dumbest deconvolution function

Description

Given x with rows and columns, and purity estimates for each column, purifyBetas takes (squeezed) logits of assay(x), divides by purity to push values towards the extremes, and then takes (de-squeezed) expits to put the purified values back on a 0-1 scale.

Usage

purify(x, purity, sqz = 1e-06, betas = TRUE)

Arguments

x

a SummarizedExperiment-like object, or a matrix of values

purity

a vector of estimated purities (sqz to 1.00000, inclusive)

sqz

a squeeze factor to avoid +/-Inf values in flogit (1e-6)

betas

are the values of assay(x) between 0 and 1? (default is TRUE)

Details

purify is even dumber and simply divides each assays(x) by purity, unless the argument betas is TRUE (the default), in which case it calls purifyBetas instead. (This is a methylation-centric package, although VAFs can be treated the same way, hence the default setting.)

  If you pass `purity` estimates of 0, you'll get an error.
           If `x` is a GenomicRatioSet, only assays(x)$Beta is purified.
           No attempt is made to preserve imprinting or any such thing,
           although the tendency of imprinted regions to fall near zero
           on a logit scale, and the fact that zero times anything is 
           still zero, does incidentally encourage this. However, any
           resemblance to biological sanity is purely coincidental.

Value

   whatever `x` is (matrix or SE), purified (see Details)

ttriche/sesamizeGEO documentation built on Nov. 12, 2023, 5:42 p.m.