cvasl.vendor.neurocombat package¶
Submodules¶
cvasl.vendor.neurocombat.neurocombat module¶
- cvasl.vendor.neurocombat.neurocombat.adjust_data_final(s_data, design, gamma_star, delta_star, stand_mean, mod_mean, var_pooled, info_dict, dat)¶
- cvasl.vendor.neurocombat.neurocombat.aprior(delta_hat)¶
- cvasl.vendor.neurocombat.neurocombat.bprior(delta_hat)¶
- cvasl.vendor.neurocombat.neurocombat.convert_zeroes(x)¶
- cvasl.vendor.neurocombat.neurocombat.find_non_eb_adjustments(s_data, LS, info_dict)¶
- cvasl.vendor.neurocombat.neurocombat.find_non_parametric_adjustments(s_data, LS, info_dict, mean_only)¶
- cvasl.vendor.neurocombat.neurocombat.find_parametric_adjustments(s_data, LS, info_dict, mean_only)¶
- cvasl.vendor.neurocombat.neurocombat.fit_LS_model_and_find_priors(s_data, design, info_dict, mean_only)¶
- cvasl.vendor.neurocombat.neurocombat.int_eprior(sdat, g_hat, d_hat)¶
- cvasl.vendor.neurocombat.neurocombat.it_sol(sdat, g_hat, d_hat, g_bar, t2, a, b, conv=0.0001)¶
- cvasl.vendor.neurocombat.neurocombat.make_design_matrix(Y, batch_col, cat_cols, num_cols, ref_level)¶
- Return Matrix containing the following parts:
one-hot matrix of batch variable (full)
one-hot matrix for each categorical_cols (removing the first column)
column for each continuous_cols
- cvasl.vendor.neurocombat.neurocombat.neuroCombat(dat, covars, batch_col, categorical_cols=None, continuous_cols=None, eb=True, parametric=True, mean_only=False, ref_batch=None)¶
Run ComBat to remove scanner effects in multi-site imaging data
Arguments¶
dat : a pandas data frame or numpy array - neuroimaging data to correct with shape = (features, samples)
covars : a pandas data frame w/ shape = (samples, covariates) - contains the batch/scanner covariate as well as additional
covariates (optional) that should be preserved during harmonization.
batch_col : string - indicates batch (scanner) column name in covars (e.g. “scanner”)
categorical_cols : list of strings - specifies column names in covars frame of categorical vars to preserve
continuous_cols : list of strings - column names in covars frame of continuous vars to be preserved
eb : should Empirical Bayes be performed? - True by default
parametric : should parametric adjustements be performed? - True by default
mean_only : should only be the mean adjusted (no scaling)? - False by default
ref_batch : batch to be used as reference for batch adjustment. - None by default
Returns¶
A dictionary of length 3: - data: A numpy array with the same shape as dat which has now been ComBat-harmonized - estimates: A dictionary of the ComBat estimates used for harmonization - info: A dictionary of the inputs needed for ComBat harmonization
- cvasl.vendor.neurocombat.neurocombat.neuroCombatFromTraining(dat, batch, estimates)¶
Combat harmonization with pre-trained ComBat estimates [UNDER DEVELOPMENT]
Arguments¶
dat : a pandas data frame or numpy array for the new dataset to harmonize - rows must be identical to the training dataset
batch : numpy array specifying scanner/batch for the new dataset - scanners/batches must also be present in the training dataset
estimates : dictionary of ComBat estimates from a previously -harmonized dataset - should be in the same format as neuroCombat(…)[‘estimates’]
Returns¶
A dictionary of length 2: - data: A numpy array with the same shape as dat which has now been ComBat-harmonized - estimates: A dictionary of the ComBat estimates used for harmonization
- cvasl.vendor.neurocombat.neurocombat.postmean(g_hat, g_bar, n, d_star, t2)¶
- cvasl.vendor.neurocombat.neurocombat.postvar(sum2, n, a, b)¶
- cvasl.vendor.neurocombat.neurocombat.standardize_across_features(X, design, info_dict)¶