flotilla.external.combat module

flotilla.external.combat.adjust_nums(numerical_covariates, drop_idxs)[source]
flotilla.external.combat.aprior(gamma_hat)[source]
flotilla.external.combat.bprior(gamma_hat)[source]
flotilla.external.combat.combat(data, batch, model=None, numerical_covariates=None)[source]

Correct for batch effects in a dataset

Parameters:

data : pandas.DataFrame

A (n_features, n_samples) dataframe of the expression or methylation data to batch correct

batch : List-like

A column corresponding to the batches in the data, in the same order as the samples in data

model : patsy.design_info.DesignMatrix, optional

A model matrix describing metadata on the samples which could be causing batch effects. If not provided, then will attempt to coarsely correct just from the information provided in batch

numerical_covariates : list-like

List of covariates in the model which are numerical, rather than categorical

Returns:

corrected : pandas.DataFrame

A (n_features, n_samples) dataframe of the batch-corrected data

flotilla.external.combat.design_mat(mod, numerical_covariates, batch_levels)[source]
flotilla.external.combat.it_sol(sdat, g_hat, d_hat, g_bar, t2, a, b, conv=0.0001)[source]
flotilla.external.combat.postmean(g_hat, g_bar, n, d_star, t2)[source]
flotilla.external.combat.postvar(sum2, n, a, b)[source]
Olga B. Botvinnik is funded by the NDSEG fellowship and is a NumFOCUS John Hunter Technology Fellow.
Michael T. Lovci was partially funded by a fellowship from Genentech.
Partially funded by NIH grants NS075449 and HG004659 and CIRM grants RB4-06045 and TR3-05676 to Gene Yeo.