Skip to contents

Modal regression GC Correction for single cell data

Usage

gc_cor_modal(
  counts,
  gc,
  valid = rep(TRUE, length(counts)),
  bin_ids = names(counts),
  lowess_frac = 0.2,
  q = c(0.1, 0.9),
  g = c(0.1, 0.9),
  results = c("counts", "default", "full")
)

Arguments

counts

Vector of counts in bins

gc

Vector of GC content in bins

valid

Vector of values corresponding to valid bins. If none provided defaults to all TRUE

bin_ids

Bin ids

lowess_frac

The smoother span. See stats::lowess() for more details

q

A tuple of quantile bounds to compute quantile regressions over read counts

g

GC quantiles over which to integrate regression curves

results

Format of results to return. One of full, default, or counts.

Value

A dataframe with the modal quantile and GC corrected counts. Results are returned based on the results parameter as follows:

full

Full dataframe containing results from each quantile curve

default

Condensed dataframe from the selected modal quantile curve

counts

Return only a vector of corrected counts