phenomedb.batch_correction

class phenomedb.batch_correction.RunCombatCorrection(query_factory=None, saved_query_id=None, username=None, task_run_id=None, comment=None, model_Y_variable=None, columns_to_include=None, model_X_variables=None, par_prior=True, prior_plots=False, mean_only=False, ref_batch=None, reload_cache=False, correction_type=None, exclude_samples_with_na_feature_values=True, scaling=None, transform='log', exclude_features_with_na_feature_values=False, pipeline_run_id=None, include_harmonised_metadata=True, batch_variable='Project', db_env=None, db_session=None, execution_date=None, exclude_features_not_in_all_projects=True)
save_results()

Save the results into HarmonisedAnnotatedFeature database table

class phenomedb.batch_correction.RunDBnormCorrection(query_factory=None, saved_query_id=None, username=None, task_run_id=None, comment=None, model_Y_variable=None, pipeline_run_id=None, model_X_variables=None, reload_cache=False, correction_type=None, imputation_method='emvf', scaling=None, transform='log', include_harmonised_metadata=True, batch_variable='Unique Batch', db_env=None, db_session=None, execution_date=None)
save_results()

Save the results into HarmonisedAnnotatedFeature database table

class phenomedb.batch_correction.RunNPYCBatchCorrection(username=None, task_run_id=None, query_factory=None, saved_query_id=None, save_correction=False, comment=None, samples_to_exclude=[], exclude_on='Run Order', exclusion_comments={}, pipeline_run_id=None, correction_type='LTR', window=11, method='LOWESS', align='median', exclude_failures=True, reload_cache=False, amend_batches=None, db_env=None, db_session=None, execution_date=None)

RunNPYCBatchCorrection. Run a batch correction using the nPYc-toolbox methods.

Parameters:

AnalysisResult (phenomedb.correction.CorrectionTask) – The CorrectionTask base class.

load_data()

Load data method. Takes the query factory or saved_query_id and loads the dataframes

Raises:

Exception – If no QueryFactory or SavedQuery object

run_analysis()

Run the correction using the specified options.

save_results()

Save the results into HarmonisedAnnotatedFeature database table

class phenomedb.batch_correction.RunNPYCBatchCorrectionReportsForExistingCorrectedFeatureDataset(username=None, task_run_id=None, saved_query_id=None, correction_type='SR', reload_cache=False, db_env=None, db_session=None, execution_date=None, pipeline_run_id=None)
RunNPYCBatchCorrectionReportsForExistingCorrectedFeatureDataset.

Sometimes it is necessary to update an existing sr_corrected_task_run with the reports. This is because we actually import the SR batch corrected dataset during the import, but its still useful to view the reports (which haven’t been generated).

Parameters:

AnalysisResult (phenomedb.correction.CorrectionTask) – The CorrectionTask base class.

load_data()

Load data method. Takes the query factory or saved_query_id and loads the dataframes

Raises:

Exception – If no QueryFactory or SavedQuery object

save_results()

Save the results into HarmonisedAnnotatedFeature database table

class phenomedb.batch_correction.RunNormResidualsMM(query_factory=None, saved_query_id=None, db_env=None, db_session=None, execution_date=None, username=None, pipeline_run_id=None, task_run_id=None, comment=None, heteroscedastic_columns=None, transform='log', exclude_features_not_in_all_projects=False, reload_cache=False, correction_type=None, columns_fixed_to_keep=None, columns_fixed_to_correct=None, scaling=None, include_harmonised_metadata=True, columns_random_to_correct=None, identifier_column='Sample File Name')
save_results()

Save the results. Reconstruct the dataframes with corrected data.

class phenomedb.batch_correction.SaveBatchCorrection(correction_data_task_run_id=None, username=None, task_run_id=None, db_env=None, db_session=None, execution_date=None, pipeline_run_id=None)