correct_bias: Correct for sequence biases in RPF counts

View source: R/correct_bias.R

correct_biasR Documentation

Correct for sequence biases in RPF counts

Description

'correct_bias' is a wrapper function that computes and applies bias correction factors from extracted regression coefficients.

'correct_interxn' corrects RPF counts using bias correction factors generated from user-provided regression coefficients; this function will use regression coefficients corresponding to interaction terms.

'correct_marginal' corrects RPF counts using bias correction factors generated from user-provided regression coefficients; this function will ignore regression coefficients corresponding to interaction terms.

'correct_fixed' corrects RPF counts using user-specified values; this function is intended to be used with values from a simulation experiment.

'correct_gc' calculates a scaling factor for RPF GC content using user-provided regression coefficients and provide GC-corrected RPF counts.

Usage

correct_bias(
  dat,
  fit_coefs,
  f5_method = NULL,
  f3_method = NULL,
  correct_gc = T,
  which_column = "count"
)

correct_interxn(dat, which_column, which_region, fit_coefs)

correct_marginal(dat, which_column, which_region, fit_coefs)

correct_fixed(dat, which_column, which_region, bias_params)

correct_gc(dat, which_column, fit_coefs)

Arguments

dat

data frame containing regression predictors

fit_coefs

data frame; output from parse_coefs()

f5_method

character; name of function to apply for 5' correction

f3_method

character; name of function to apply for 3' correction

correct_gc

logical; whether to correct for RPF GC-content

which_column

character; name of column in dat containing uncorrected counts

which_region

character; one of "f5" or "f3" corresponding to RPF region

bias_params

named numeric vector; recovery probabilities from simulation

Value

A numeric vector corresponding to 'dat' containing bias-corrected RPF counts

Functions

  • correct_interxn: Use regression coefficients as scaling factors for bias correction

  • correct_marginal: Use regression coefficients as scaling factors for bias correction

  • correct_fixed: Use simulation parameters as bias correction factors

  • correct_gc: Correct for RPF GC-content


amandamok/choros documentation built on March 15, 2023, 7:57 p.m.