All functions

adjust_by_t()

Returns adjusted sebetahat's based on t likelihood so that we can use a normal likelihood.

ash_ruv2()

Use control genes to estimate hidden confounders and variance inflation parameter, then run ASH.

ash_ruv4()

Use control genes to estimate hidden confounders and variance inflation parameter, then run ASH.

ash_wrap()

Wrapper for ash.workhorse for use in caw.

back_elbo()

The Evidence lower bound.

back_fix()

Fixed point iteration for BACKWASH.

back_obj()

Objective function for BACKWASH.

back_update_phi()

Update for the "g" hyperparameter.

back_update_pi()

Update for the prior mixing proportions.

back_update_qbeta()

Update for the variational density of beta

back_update_v()

Update for the variational density of v.

back_update_xi()

Update for the variance scaling parameter.

backwash()

BACKWASH: Bayesian Adjustment for Confounding Knitted With Adaptive SHrinkage.

backwash_second_step()

Second step of the backwash procedure.

bfa_gd_gibbs()

Fast Gibbs sampler for Bayesian factor analysis.

bfa_gs()

Bayesian factor analysis used in Gerard and Stephens (2021).

bfa_gs_linked()

Simple Bayesian low rank matrix decomposition.

bfa_gs_linked_gibbs()

Fast Gibbs sampler for Bayesian factor analysis.

bfa_gs_linked_gibbs_r()

R implementation of bfa_gs_linked_gibbs.

bfa_wrapper()

Wrapper for the bfa package.

bfl()

Simple Bayesian low rank matrix decomposition.

brent_obj_norm()

Objective function for updating variance inflation parameter during EM for mixtures of normals prior.

bsvd()

Gibbs sampler for Bayesian SVD.

calc_lfsr()

Empirical estimate of lfsr based on posterior samples.

calc_lfsr_g()

Same as calc_lfsr except with a prior specification.

calc_mean_g()

Calculate moments of pointmass rv's.

calc_quantiles_g()

Calculate quantiles of pointmass rv's.

caw()

Iterative procedure for confounder correction with a procedure that returns lfdrs.

clean_my_p()

Use the distribution of control genes' p-values to adjust all of the p-values.

clean_my_stats()

Quantile normalize stats to their theoretical distributions.

cruv4()

RUV4's second step.

cruv4_multicov()

RUV4's second step.

dnormalmix()

Density of a mixture of normals

dt_wrap()

Wrapper for dt with a non-zero mean and non-1 scale parameter.

em_miss()

EM algorithm for factor analysis with missing block matrix.

em_miss_fix()

Fixed point iteration for em algorithm with missing block.

em_miss_fix_fast()

Faster version of em_miss_fix.

em_miss_obj()

The objective function for em with a missing block.

em_miss_obj_fast()

A faster version of em_miss_obj.

fa_ml()

Wrapper for cate's fa.em function.

fa_out_test()

Test output form fa_func.

fa_tester()

Tests whether a user-specified factor analysis function is appropriate for use in vruv4, ruv3, mouthwash, or backwash.

fa_tester_ruvb()

Test whether a user-specified function is compatible with ruvb.

fix_caw()

A fixed point iteration for CAW.

fix_caw_wrapper()

A wrapper for fix_caw so that I can use SQUAREM.

gdfa()

Old version of Bayesian factor analysis.

get_grid_var()

Default way to set grid of variances.

hard_impute()

My version of hard imputation that begins at the ruv estimates

hier_fun()

Hierarchical prior density function as described in Gerard and Stephens (2021)

impute_block()

Constructs an overall matrix, then applies a given imputation function.

impute_ruv_reproduce()

Reproduce RUV2, RUV3, and RUV4 with RUVimpute.

initialize_mixing_prop()

Function for initializing mixing proportions.

knn_wrapper()

Wrapper for impute.knn

missforest_wrapper()

Wrapper for missForest package.

mouthwash()

MOUTHWASH: Maximize Over Unobservables To Help With Adaptive SHrinkage.

mouthwash_coordinate()

Coordinate ascent for optimizing t likelihood with uniform mixtures.

mouthwash_second_step()

The second step of MOUTHWASH.

mouthwash_z_grad()

Gradient wrt z of uniform_mix_llike.

normal_mix_fix()

A fixed point iteration for updating the mixing proportions and the confounders associated with the covariates of interest when using a mixture of normals prior.

normal_mix_fix_wrapper()

Wrapper for normal_mix_fix so that I can use SQUAREM.

normal_mix_llike()

Penalized MOUTHWASH likelihood when using a mixture of normals.

normal_mix_llike_wrapper()

Wrapper for normal_mix_llike so that I can use it in SQUAREM.

normal_prior()

A basic normal prior density function.

pca_2step()

PCA when first vr rows have a variance multiplicatively different from the rest of the rows.

pca_naive()

Basic PCA.

pca_ruv2()

PCA when first vr rows have a variance multiplicatively different from the rest of the rows.

pcaruv2_fix()

Fix point for mle in pca_ruv2.

pcaruv2_obj()

The objective function for mle in pca_ruv2.

plot(<backwash>)

Plotting method for backwash.

plot(<mouthwash>)

Plotting method for moutwash.

plot(<ruvb>)

Plotting method for ruvb.

prior_fun_wrapper()

Wrapper for prior_fun so that can be called in apply.

pt_wrap()

Wrapper for pt with a non-zero mena and non-1 scale parameter.

ptdiff()

More stable way to calculate differences in T cdf's.

ptdiff_mat()

More stable way to calculate differences in T cdfs when input is a matrix.

ptdiff_mat_log()

Log version of ptdiff_mat.

qmle_obj()

Objective function for quasi-mle approach.

qmle_obj_basic()

Basic no optimized code objective function.

qmle_ruv2()

Quasi-mle when first vr rows of Y have variances which differ by a scale factor from the rest of the rows.

qmle_ruv2_lambda_grid()

Quasi-mle when first vr rows of Y have variances which differ by a scale factor from the rest of the rows.

qr_ident()

An identified QR decomposition.

rmixnorm()

Draw from a mixture of normals.

rnormalmix()

Random draw from a mixture of normals.

rotate_model()

QR rotation to independent models.

rubin_copy()

Very inefficient copy of Rubin and Thayer iteration mostly meant for debugging.

ruv3()

Removing Unwanted Variation 3.

ruvb()

Bayesian version of Removing Unwanted Variation.

ruvem()

Same as ruvimpute but only does ruvem and comes up with estimates of standard errors.

ruvimpute()

General imputation framework.

sim_gtex

A simulated RNA-seq dataset.

smell_my_p()

Wrapper for a Kolmogorov-Smirnov test using the p-values from the control genes.

smell_my_stats()

Wrapper for a Kolmogorov-Smirnov test using the statistics from the control genes.

softimpute_wrapper()

A wrapper for using the softImpute function from the softImpute package.

tregress_em()

EM algorithm to find regression coefficients using t-likelihood when variances are known up to scale.

tregress_fix()

Fixed point iteration for EM algorithm for regression with t-errors where the variance is known up to scale.

tregress_obj()

The likelihood for regression with t-errors where the variance is known up to scale.

tregress_obj_wrapper()

Wrapper for tregress_obj.

unif_int_grad()

Gradient wrt z2 of intermediate function in EM.

unif_int_obj()

Intermediate objective function in EM.

uniform_mix_fix()

Fixed point iteration when using t errors and a mixture of uniforms prior.

uniform_mix_fix_wrapper()

Wrapper for uniform_mix_fix, mostly so I can use SQUAREM.

uniform_mix_llike()

Log-likelihood when using t errors and mixture of uniforms prior.

uniform_mix_llike_wrapper()

Wrapper for uniform_mix_llike, mostly for the SQUAREM package.

update_f()

Utility function for updating F in gdfa.

update_lambda()

Wrapper for optim and qmle_obj.

update_sig_alpha()

Fast update for sig_diag and alpha.

update_sig_alpha_basic()

Basic no optimized code update for sig_diag and alpha.

vicar

vicar: Various Ideas for Confounder Adjustment in Regression.

vruv2()

Calibrated RUV2.

vruv2_old()

Old version of Calibrated RUV2 that doesn't really work.

vruv4()

Calibrated RUV4 where the control genes are used to estimate hidden confounders and a variance inflation parameter.

vruvinv()

Variance inflated RUV-inverse.