hplc_data_analysis.hplc

class hplc_data_analysis.hplc.Project(folder_path, projectname=None, file_load_skiprows=18, file_load_delimiter='\\t', columns_to_rename_and_keep_in_files=None, compounds_to_rename_in_files=None, param_to_axis_label=None, plot_font='Dejavu Sans', plot_grid=False)[source]

Bases: object

create_compounds_properties(update_saved_files_info=True)[source]
create_files_info(update_saved_files_info=False)[source]
Return type:

DataFrame

create_files_param_aggrrep(param='conc_vial_mg_L')[source]

Aggregates compound concentration data by functional group for each parameter across all FILES, providing a summarized view of functional group concentrations. This aggregation facilitates the understanding of functional group distribution across FILES.

create_files_param_report(param='conc_vial_mg_L')[source]

Create a report that consolidates the values of a specified parameter from different DataFrames, using the union of all indices found in the individual DataFrames.

Parameters:

param – The parameter to extract from each DataFrame. Defaults to “conc_vial_mg_L”.

Returns:

A DataFrame containing the consolidated report.

create_list_of_unique_compounds()[source]
Return type:

list[str]

create_replicates_info()[source]

Creates a summary ‘replicates_info’ DataFrame from ‘files_info’, aggregating data for each replicate, and updates the ‘replicates_info’ attribute with this summarized data.

create_replicates_param_aggrrep(param='conc_vial_mg_L')[source]

Aggregates compound concentration data by functional group for each parameter across all FILES, providing a summarized view of functional group concentrations. This aggregation facilitates the understanding of functional group distribution across FILES.

create_replicates_param_report(param='conc_vial_mg_L')[source]

Create a report that consolidates the values of a specified parameter from different DataFrames, using the union of all indices found in the individual DataFrames.

Parameters:

param – The parameter to extract from each DataFrame. Defaults to “conc_vial_mg_L”.

Returns:

A DataFrame containing the consolidated report.

create_samples()[source]
create_samples_info()[source]

Creates a summary ‘samples_info’ DataFrame from ‘files_info’, aggregating data for each sample, and updates the ‘samples_info’ attribute with this summarized data.

create_samples_param_aggrrep(param='conc_vial_mg_L')[source]
create_samples_param_report(param='conc_vial_mg_L')[source]

Create two reports that consolidate the average and standard deviation of a specified parameter from different sample DataFrames, assuming both sets of DataFrames share the same indices.

Parameters:

param – The parameter to extract from each DataFrame. Defaults to “conc_vial_mg_L”.

Returns:

A tuple of two DataFrames containing the consolidated averages and standard deviations.

load_class_code_frac()[source]
load_compounds_properties()[source]

Attempts to load the ‘compounds_properties.xlsx’ file containing physical and chemical properties of compounds. If not found, it creates a new properties DataFrame and updates the ‘compounds_properties_created’ attribute.

load_files_info(update_saved_files_info=True)[source]

Loads the files information from an Excel file and returns it as a DataFrame.

Parameters:

update_saved_files_info (bool, optional) – Specifies whether to update the saved files_info.xlsx file.

Returns:

The loaded files information as a DataFrame.

Return type:

pd.DataFrame

plot_report(report_or_aggrrep='report', files_replicates_or_samples='samples', param='conc_vial_mg_L', names_to_keep=None, labels=None, show_total_in_twinx=False, y_axis_min_threshold=None, item_to_color_to_hatch=None, yt_sum_label='total\\n(right axis)', remove_insignificant_values=False, **kwargs)[source]
Return type:

MyFigure

save_files_samples_reports()[source]
class hplc_data_analysis.hplc.Sample(project, samplename, sample_info)[source]

Bases: object

create_ave_std_from_replicates(replicates)[source]
Return type:

tuple[DataFrame]

create_replicate_from_files(files_to_merge, replicatename)[source]
load_single_file(filename)[source]
Return type:

DataFrame

hplc_data_analysis.hplc.apply_hatches_to_ax(ax, hatches_list)[source]

Apply hatch patterns to bars in the bar plots of each subplot.

This method iterates over all subplots and applies predefined hatch patterns to each bar, enhancing the visual distinction between bars, especially in black and white printouts.

Return type:

None