autoemxsp.runners.analyze_sample module

Run clustering and analysis for a single sample.

param sample_ID:

Sample identifier.

type sample_ID:

str

param results_path:

Directory where results are loaded and stored. If None, defaults to autoemxsp/Results

type results_path:

str, optional

param output_filename_suffix:

Suffix for output files.

type output_filename_suffix:

str, optional

param ref_formulae:

Reference formulae for clustering. If the first entry is “” or None, the rest are appended to the list loaded from Comp_analysis_configs.json; otherwise, the provided list replaces it.

type ref_formulae:

list of str, optional

param els_excluded_clust_plot:

Elements to exclude from cluster plot.

type els_excluded_clust_plot:

list of str, optional

param clustering_features:

Features to use for clustering.

type clustering_features:

list of str, optional

param k_finding_method:
Method for determining optimal number of clusters. Set to “forced” if a value of ‘k’ is specified manually.

Allowed methods are “silhouette”, “calinski_harabasz”, “elbow”.

type k_finding_method:

str, optional

param k_forced:

Forced number of clusters.

type k_forced:

int, optional

param do_matrix_decomposition:

Whether to compute matrix decomposition for intermixed phases. Slow if many candidate phases are provided. Default: True..

type do_matrix_decomposition:

bool, optional

param max_analytical_error_percent:

Maximum analytical error allowed for clustering.

type max_analytical_error_percent:

float, optional

param quant_flags_accepted:

Accepted quantification flags.

type quant_flags_accepted:

list of int, optional

param plot_custom_plots:

Whether to use custom plots.

type plot_custom_plots:

bool, optional

param show_unused_compositions_cluster_plot:

Whether to show unused compositions in cluster plot.

type show_unused_compositions_cluster_plot:

bool, optional

returns:

comp_analyzer – The composition analysis object containing the results and methods for further analysis.

rtype:

EMXSp_Composition_Analyzer