SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
Elemental_Profile_Set Class Reference

Manages a collection of elemental profiles (samples) for source fingerprinting analysis. More...

#include <elemental_profile_set.h>

Inheritance diagram for Elemental_Profile_Set:
Inheritance graph
Collaboration diagram for Elemental_Profile_Set:
Collaboration graph

Public Member Functions

 Elemental_Profile_Set ()
 Elemental_Profile_Set (const Elemental_Profile_Set &other)
Elemental_Profile_Set & operator= (const Elemental_Profile_Set &other)
Elemental_Profile * AppendProfile (const string &name, const Elemental_Profile &profile=Elemental_Profile(), map< string, element_information > *elementinfo=nullptr)
 Add a new sample profile to the set.
void AppendProfiles (const Elemental_Profile_Set &profiles, map< string, element_information > *elementinfo)
 Add multiple profiles from another set.
void UpdateElementDistributions ()
 Rebuild element distributions from all profiles.
Elemental_Profile * GetProfile (const string &name)
 Get profile by sample name (mutable).
Elemental_Profile GetProfile (const string &name) const
 Get profile by sample name (const).
Elemental_Profile * GetProfile (unsigned int index)
 Get profile by index (mutable).
Elemental_Profile GetProfile (unsigned int index) const
 Get profile by index (const).
vector< string > GetSampleNames () const
 Get all sample names in the set.
vector< string > GetElementNames () const
 Get all element names (from first profile).
vector< double > GetAllConcentrationsFor (const string &element_name)
 Get all concentration values for a specific element across samples.
vector< double > GetConcentrationsForSample (const string &sample_name) const
 Get all element concentrations for a specific sample.
bool ContainsElement (const string &element_name) const
 Check if an element exists in ALL profiles.
Elemental_Profile_Set ExtractElements (const vector< string > &element_list) const
 Create subset with only specified elements.
Elemental_Profile_Set ExtractChemicalElements (const map< string, element_information > *elementinfo, bool isotopes) const
 Create subset with only chemical elements (and optionally isotopes).
Elemental_Profile_Set CreateCorrectedSet (bool exclude_samples, bool exclude_elements, bool omnsizecorrect, const vector< double > &om_size, const map< string, element_information > *elementinfo=nullptr) const
 Create corrected and filtered subset.
Elemental_Profile_Set CopyIncludedInAnalysis (bool applyomsizecorrection, const vector< double > &om_size, map< string, element_information > *elementinfo=nullptr)
 Copy only samples marked for inclusion in analysis.
Elemental_Profile_Set EliminateSamples (const vector< string > &samples_to_eliminate, map< string, element_information > *elementinfo) const
 Create subset excluding specified samples.
ConcentrationSet * GetElementDistribution (const string &element_name)
 Get distribution for a specific element (mutable).
ConcentrationSet GetElementDistribution (const string &element_name) const
 Get distribution for a specific element (const).
distribution_type GetAssignedDistribution (const string &element_name) const
 Get assigned distribution type for an element.
CVector CalculateElementMeans (const vector< string > &element_order=vector< string >()) const
 Calculate mean concentration for each element.
CMBMatrix CalculateCovarianceMatrix ()
 Calculate covariance matrix across elements.
CMBMatrix CalculateCorrelationMatrix ()
 Calculate correlation matrix across elements.
CMBVector CalculateKolmogorovSmirnovStatistics (distribution_type dist_type)
 Calculate Kolmogorov-Smirnov statistics for all elements.
double GetMaximum () const
 Get maximum concentration across all elements and samples.
double GetMinimum () const
 Get minimum concentration across all elements and samples.
double GetEstimatedMu (const string &element) const
 Get estimated mu parameter for an element.
double GetEstimatedSigma (const string &element) const
 Get estimated sigma parameter for an element.
bool SetEstimatedMu (const string &element, const double &value)
 Set estimated mu parameter for an element.
bool SetEstimatedSigma (const string &element, const double &value)
 Set estimated sigma parameter for an element.
Distribution * GetEstimatedDistribution (const string &element_name)
 Get estimated distribution for an element (for MCMC optimization).
Distribution * GetFittedDistribution (const string &element_name)
 Get fitted distribution for an element (from data, for likelihood).
MultipleLinearRegressionSet BuildRegressionModels (const string &om, const string &d, regression_form form=regression_form::linear, const double &p_value_threshold=0.05)
 Build MLR models for all elements vs OM and particle size.
MultipleLinearRegression BuildRegressionModel (const string &element, const string &om, const string &d, regression_form form=regression_form::linear, const double &p_value_threshold=0.05)
 Build MLR model for single element vs OM and particle size.
void SetRegressionModels (const string &om, const string &d, regression_form form=regression_form::linear, const double &p_value_threshold=0.05)
 Set regression models (build new).
void SetRegressionModels (const MultipleLinearRegressionSet *mlrset)
 Set regression models (copy existing).
MultipleLinearRegressionSet * GetRegressionModels ()
 Get internal regression model set.
ResultItem GetRegressionsAsResult ()
 Get regressions wrapped in ResultItem for display.
Elemental_Profile_Set ApplyOrganicMatterAndSizeCorrections (const vector< double > &om_size, map< string, element_information > *elementinfo=nullptr)
 Apply OM and particle size corrections to all profiles.
CMBVector CalculateBoxCoxParameters ()
 Calculate optimal Box-Cox lambda for each element.
vector< string > ElementsNotBoxCoxTransformable () const
 Elements with a zero or negative value, which Box-Cox leaves untransformed.
Elemental_Profile_Set ApplyBoxCoxTransform (CMBVector *lambda_vals=nullptr)
 Apply Box-Cox transformation to all profiles.
CMBMatrix DetectOutliers (const double &lowerlimit=0, const double &upperlimit=0)
 Detect outliers using Box-Cox transformation and standardization.
bool OutlierAnalysisDone () const
 Check if outlier analysis has been performed.
vector< string > CheckForNegativeValues (const vector< string > &element_names) const
 Check for elements with negative values.
bool SetContribution (const double &value)
 Set contribution value for this source.
double GetContribution () const
 Get contribution value.
bool SetContributionSoftmax (const double &value)
 Set softmax-transformed contribution.
double GetContributionSoftmax () const
 Get softmax-transformed contribution.
Elemental_Profile SelectTopElementsAggregate (int n) const
 Select top N elements across all samples (aggregate minimum).
CMBVector CalculateDotProduct (const CVector &v) const
 Calculate dot product of each profile with weight vector.
CMBMatrix ToMatrix () const
 Convert to matrix format (samples × elements).
gsl_matrix * CopyToGSLMatrix () const
 Convert to GSL matrix for statistical functions.
string ToString () const override
 Convert object to string representation.
QTableWidget * ToTable () override
 Create a Qt table widget representation of the data.
bool writetofile (QFile *file) override
 Write object data to a file.
QJsonObject toJsonObject () const override
 Serialize object to JSON format.
bool ReadFromJsonObject (const QJsonObject &jsonobject) override
 Deserialize object from JSON format.
bool ReadFromJsonObject (const QJsonObject &jsonobject, QString &error)
 Reads every profile, refusing any value that is not a finite number.
bool Read (const QStringList &strlist) override
 Parse object data from a string list.
Public Member Functions inherited from Interface
 Interface ()
 Default constructor.
 Interface (const Interface &intf)
 Copy constructor.
Interface & operator= (const Interface &intf)
 Assignment operator.
string GetNotes () const
 Get the notes/annotations associated with this object.
void SetNotes (const string &note)
 Set the notes for this object, replacing any existing notes.
void AppendtoNotes (const string &note)
 Append a note to existing notes.
void ClearNotes ()
 Clear all notes associated with this object.
void SetLimit (_range lowhigh, const double &value)
 Set upper or lower limit for value highlighting.
void SetOption (options_key opt, bool val)
 Set a configuration option.
bool Option (options_key opt)
 Get the current value of a configuration option.
options & GetOptions ()
 Get reference to the options structure.
QString XAxisLabel () const
 Get the X-axis label.
QString YAxisLabel () const
 Get the Y-axis label.
bool SetXAxisLabel (const QString &label)
 Set the X-axis label.
bool SetYAxisLabel (const QString &label)
 Set the Y-axis label.

Private Attributes

map< string, ConcentrationSet > element_distributions_
 Concentration distributions for each element.
MultipleLinearRegressionSet mlr_vs_om_size_
 MLR models for OM/size corrections.
double contribution_ = 0.0
 Source contribution (for CMB).
double contribution_softmax_ = 0.0
 Softmax-transformed contribution.
bool outlierdone_ = false
 Flag indicating outlier analysis performed.

Additional Inherited Members

Public Attributes inherited from Interface
double lowlimit {}
 Lower threshold for value highlighting (when enabled).
double highlimit {}
 Upper threshold for value highlighting (when enabled).
bool highlightoutsideoflimit = false
 Flag indicating whether to highlight values outside defined limits.

Detailed Description

Manages a collection of elemental profiles (samples) for source fingerprinting analysis.

This class stores multiple Elemental_Profile objects (one per sample) and provides:

  • Statistical analysis across samples (distributions, covariance, correlation)
  • Data extraction and filtering operations
  • Organic matter and particle size corrections via multiple linear regression
  • Box-Cox transformations and outlier detection
  • Source contribution tracking for CMB (Chemical Mass Balance) analysis

Definition at line 30 of file elemental_profile_set.h.

Constructor & Destructor Documentation

◆ Elemental_Profile_Set() [1/2]

◆ Elemental_Profile_Set() [2/2]

Elemental_Profile_Set::Elemental_Profile_Set ( const Elemental_Profile_Set & other)

Member Function Documentation

◆ AppendProfile()

◆ AppendProfiles()

void Elemental_Profile_Set::AppendProfiles ( const Elemental_Profile_Set & profiles,
map< string, element_information > * elementinfo )

Add multiple profiles from another set.

Parameters
profilesSource profile set
elementinfoOptional element metadata for filtering

Definition at line 208 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), AppendProfile(), and UpdateElementDistributions().

Referenced by SourceSinkData::LumpAllProfileSets().

◆ ApplyBoxCoxTransform()

Elemental_Profile_Set Elemental_Profile_Set::ApplyBoxCoxTransform ( CMBVector * lambda_vals = nullptr)

Apply Box-Cox transformation to all profiles.

Definition at line 892 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), ConcentrationSet::ApplyBoxCoxTransform(), CalculateBoxCoxParameters(), distribution, and element_distributions_.

◆ ApplyOrganicMatterAndSizeCorrections()

Elemental_Profile_Set Elemental_Profile_Set::ApplyOrganicMatterAndSizeCorrections ( const vector< double > & om_size,
map< string, element_information > * elementinfo = nullptr )

Apply OM and particle size corrections to all profiles.

Definition at line 770 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), AppendProfile(), Elemental_Profile::ApplyOrganicMatterAndSizeCorrections(), and mlr_vs_om_size_.

Referenced by CopyIncludedInAnalysis().

◆ BuildRegressionModel()

MultipleLinearRegression Elemental_Profile_Set::BuildRegressionModel ( const string & element,
const string & om,
const string & d,
regression_form form = regression_form::linear,
const double & p_value_threshold = 0.05 )

◆ BuildRegressionModels()

MultipleLinearRegressionSet Elemental_Profile_Set::BuildRegressionModels ( const string & om,
const string & d,
regression_form form = regression_form::linear,
const double & p_value_threshold = 0.05 )

Build MLR models for all elements vs OM and particle size.

Definition at line 492 of file elemental_profile_set.cpp.

References BuildRegressionModel(), and GetElementNames().

Referenced by SetRegressionModels().

◆ CalculateBoxCoxParameters()

CMBVector Elemental_Profile_Set::CalculateBoxCoxParameters ( )

Calculate optimal Box-Cox lambda for each element.

Note
Elements with zero or negative values get lambda = 1 and are not transformed; see ElementsNotBoxCoxTransformable()

Definition at line 803 of file elemental_profile_set.cpp.

References distribution, element_distributions_, and CMBVector::SetLabel().

Referenced by ApplyBoxCoxTransform(), and DetectOutliers().

◆ CalculateCorrelationMatrix()

CMBMatrix Elemental_Profile_Set::CalculateCorrelationMatrix ( )

Calculate correlation matrix across elements.

Definition at line 619 of file elemental_profile_set.cpp.

References CopyToGSLMatrix(), GetElementNames(), CMBMatrix::SetColumnLabel(), and CMBMatrix::SetRowLabel().

◆ CalculateCovarianceMatrix()

CMBMatrix Elemental_Profile_Set::CalculateCovarianceMatrix ( )

Calculate covariance matrix across elements.

Definition at line 576 of file elemental_profile_set.cpp.

References CopyToGSLMatrix(), GetElementNames(), CMBMatrix::SetColumnLabel(), and CMBMatrix::SetRowLabel().

◆ CalculateDotProduct()

CMBVector Elemental_Profile_Set::CalculateDotProduct ( const CVector & v) const

Calculate dot product of each profile with weight vector.

Definition at line 1000 of file elemental_profile_set.cpp.

References CMBVector::SetLabel().

◆ CalculateElementMeans()

CVector Elemental_Profile_Set::CalculateElementMeans ( const vector< string > & element_order = vector<string>()) const

Calculate mean concentration for each element.

Definition at line 698 of file elemental_profile_set.cpp.

References element_distributions_, and GetElementNames().

◆ CalculateKolmogorovSmirnovStatistics()

CMBVector Elemental_Profile_Set::CalculateKolmogorovSmirnovStatistics ( distribution_type dist_type)

Calculate Kolmogorov-Smirnov statistics for all elements.

Definition at line 682 of file elemental_profile_set.cpp.

References GetElementDistribution(), GetElementNames(), and CMBVector::SetLabels().

◆ CheckForNegativeValues()

vector< string > Elemental_Profile_Set::CheckForNegativeValues ( const vector< string > & element_names) const

Check for elements with negative values.

Definition at line 952 of file elemental_profile_set.cpp.

References GetElementDistribution(), and GetMinimum().

◆ ContainsElement()

bool Elemental_Profile_Set::ContainsElement ( const string & element_name) const

Check if an element exists in ALL profiles.

Definition at line 337 of file elemental_profile_set.cpp.

◆ CopyIncludedInAnalysis()

Elemental_Profile_Set Elemental_Profile_Set::CopyIncludedInAnalysis ( bool applyomsizecorrection,
const vector< double > & om_size,
map< string, element_information > * elementinfo = nullptr )

Copy only samples marked for inclusion in analysis.

Definition at line 118 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), AppendProfile(), ApplyOrganicMatterAndSizeCorrections(), mlr_vs_om_size_, and SetRegressionModels().

◆ CopyToGSLMatrix()

gsl_matrix * Elemental_Profile_Set::CopyToGSLMatrix ( ) const

Convert to GSL matrix for statistical functions.

Definition at line 658 of file elemental_profile_set.cpp.

References GetElementNames(), and matrix.

Referenced by CalculateCorrelationMatrix(), and CalculateCovarianceMatrix().

◆ CreateCorrectedSet()

Elemental_Profile_Set Elemental_Profile_Set::CreateCorrectedSet ( bool exclude_samples,
bool exclude_elements,
bool omnsizecorrect,
const vector< double > & om_size,
const map< string, element_information > * elementinfo = nullptr ) const

Create corrected and filtered subset.

Parameters
exclude_samplesIf true, exclude samples marked as excluded
exclude_elementsIf true, exclude elements marked as excluded
omnsizecorrectIf true, apply organic matter and size corrections
om_sizeTarget OM and size values for correction
elementinfoElement metadata for filtering

Definition at line 56 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), AppendProfile(), mlr_vs_om_size_, and SetRegressionModels().

◆ DetectOutliers()

CMBMatrix Elemental_Profile_Set::DetectOutliers ( const double & lowerlimit = 0,
const double & upperlimit = 0 )

Detect outliers using Box-Cox transformation and standardization.

Parameters
lowerlimitLower threshold for standardized values
upperlimitUpper threshold for standardized values
Returns
Matrix of outlier magnitudes

Definition at line 819 of file elemental_profile_set.cpp.

References ConcentrationSet::ApplyBoxCoxTransform(), ConcentrationSet::BoxCoxTransformValue(), CalculateBoxCoxParameters(), ConcentrationSet::CalculateMean(), ConcentrationSet::CalculateStdDev(), distribution, element_distributions_, outlierdone_, CMBMatrix::SetColumnLabel(), and CMBMatrix::SetRowLabel().

◆ ElementsNotBoxCoxTransformable()

vector< string > Elemental_Profile_Set::ElementsNotBoxCoxTransformable ( ) const

Elements with a zero or negative value, which Box-Cox leaves untransformed.

Definition at line 792 of file elemental_profile_set.cpp.

References distribution, and element_distributions_.

◆ EliminateSamples()

Elemental_Profile_Set Elemental_Profile_Set::EliminateSamples ( const vector< string > & samples_to_eliminate,
map< string, element_information > * elementinfo ) const

Create subset excluding specified samples.

Definition at line 145 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), AppendProfile(), mlr_vs_om_size_, and SetRegressionModels().

◆ ExtractChemicalElements()

Elemental_Profile_Set Elemental_Profile_Set::ExtractChemicalElements ( const map< string, element_information > * elementinfo,
bool isotopes ) const

Create subset with only chemical elements (and optionally isotopes).

Parameters
elementinfoElement metadata for classification
isotopesWhether to include isotopes

Definition at line 91 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), and AppendProfile().

◆ ExtractElements()

Elemental_Profile_Set Elemental_Profile_Set::ExtractElements ( const vector< string > & element_list) const

Create subset with only specified elements.

Definition at line 105 of file elemental_profile_set.cpp.

References Elemental_Profile_Set(), and AppendProfile().

◆ GetAllConcentrationsFor()

vector< double > Elemental_Profile_Set::GetAllConcentrationsFor ( const string & element_name)

Get all concentration values for a specific element across samples.

Definition at line 423 of file elemental_profile_set.cpp.

Referenced by BuildRegressionModel().

◆ GetAssignedDistribution()

distribution_type Elemental_Profile_Set::GetAssignedDistribution ( const string & element_name) const

Get assigned distribution type for an element.

◆ GetConcentrationsForSample()

vector< double > Elemental_Profile_Set::GetConcentrationsForSample ( const string & sample_name) const

Get all element concentrations for a specific sample.

Definition at line 442 of file elemental_profile_set.cpp.

Referenced by SourceSinkData::ExtractConcentrationData().

◆ GetContribution()

double Elemental_Profile_Set::GetContribution ( ) const
inline

Get contribution value.

Definition at line 356 of file elemental_profile_set.h.

References contribution_.

Referenced by SourceSinkData::GetContributionVector().

◆ GetContributionSoftmax()

double Elemental_Profile_Set::GetContributionSoftmax ( ) const
inline

Get softmax-transformed contribution.

Definition at line 366 of file elemental_profile_set.h.

References contribution_softmax_.

Referenced by SourceSinkData::GetContributionVectorSoftmax().

◆ GetElementDistribution() [1/2]

ConcentrationSet * Elemental_Profile_Set::GetElementDistribution ( const string & element_name)

◆ GetElementDistribution() [2/2]

ConcentrationSet Elemental_Profile_Set::GetElementDistribution ( const string & element_name) const

Get distribution for a specific element (const).

Definition at line 1025 of file elemental_profile_set.cpp.

References element_distributions_.

◆ GetElementNames()

◆ GetEstimatedDistribution()

Distribution * Elemental_Profile_Set::GetEstimatedDistribution ( const string & element_name)

Get estimated distribution for an element (for MCMC optimization).

Definition at line 1036 of file elemental_profile_set.cpp.

References element_distributions_.

Referenced by SourceSinkData::BuildSourceMeanMatrix(), SourceSinkData::BuildSourceMeanMatrix_Isotopes(), and SourceSinkData::IsotopeBaseMean().

◆ GetEstimatedMu()

double Elemental_Profile_Set::GetEstimatedMu ( const string & element) const

Get estimated mu parameter for an element.

◆ GetEstimatedSigma()

double Elemental_Profile_Set::GetEstimatedSigma ( const string & element) const

Get estimated sigma parameter for an element.

◆ GetFittedDistribution()

Distribution * Elemental_Profile_Set::GetFittedDistribution ( const string & element_name)

Get fitted distribution for an element (from data, for likelihood).

Definition at line 1044 of file elemental_profile_set.cpp.

References element_distributions_.

Referenced by SourceSinkData::IsotopeBaseMean().

◆ GetMaximum()

double Elemental_Profile_Set::GetMaximum ( ) const

Get maximum concentration across all elements and samples.

Definition at line 453 of file elemental_profile_set.cpp.

Referenced by GeneralChart::PlotProfileSet().

◆ GetMinimum()

double Elemental_Profile_Set::GetMinimum ( ) const

Get minimum concentration across all elements and samples.

Definition at line 472 of file elemental_profile_set.cpp.

Referenced by CheckForNegativeValues(), and GeneralChart::PlotProfileSet().

◆ GetProfile() [1/4]

Elemental_Profile * Elemental_Profile_Set::GetProfile ( const string & name)

Get profile by sample name (mutable).

Returns
Pointer to profile, or nullptr if not found

Definition at line 373 of file elemental_profile_set.cpp.

References name.

Referenced by SourceSinkData::ObservedDataforSelectedSample(), SourceSinkData::ObservedDataforSelectedSample_Isotope(), and SourceSinkData::ObservedDataforSelectedSample_Isotope_delta().

◆ GetProfile() [2/4]

Elemental_Profile Elemental_Profile_Set::GetProfile ( const string & name) const

Get profile by sample name (const).

Returns
Copy of profile, or empty profile if not found

Definition at line 397 of file elemental_profile_set.cpp.

References name.

◆ GetProfile() [3/4]

Elemental_Profile * Elemental_Profile_Set::GetProfile ( unsigned int index)

Get profile by index (mutable).

Returns
Pointer to profile, or nullptr if index out of range

Definition at line 384 of file elemental_profile_set.cpp.

◆ GetProfile() [4/4]

Elemental_Profile Elemental_Profile_Set::GetProfile ( unsigned int index) const

Get profile by index (const).

Returns
Copy of profile, or empty profile if index out of range

Definition at line 408 of file elemental_profile_set.cpp.

◆ GetRegressionModels()

MultipleLinearRegressionSet * Elemental_Profile_Set::GetRegressionModels ( )

Get internal regression model set.

Definition at line 569 of file elemental_profile_set.cpp.

References mlr_vs_om_size_.

◆ GetRegressionsAsResult()

ResultItem Elemental_Profile_Set::GetRegressionsAsResult ( )

Get regressions wrapped in ResultItem for display.

Definition at line 561 of file elemental_profile_set.cpp.

References mlr_vs_om_size_, mlrset, ResultItem::SetResult(), and ResultItem::SetType().

◆ GetSampleNames()

vector< string > Elemental_Profile_Set::GetSampleNames ( ) const

Get all sample names in the set.

Definition at line 222 of file elemental_profile_set.cpp.

Referenced by SourceSinkData::GetSampleNames().

◆ operator=()

◆ OutlierAnalysisDone()

bool Elemental_Profile_Set::OutlierAnalysisDone ( ) const
inline

Check if outlier analysis has been performed.

Definition at line 339 of file elemental_profile_set.h.

References outlierdone_.

◆ Read()

bool Elemental_Profile_Set::Read ( const QStringList & strlist)
overridevirtual

Parse object data from a string list.

Parameters
strlistList of strings containing the data to parse
Returns
true if parsing was successful, false otherwise

Pure virtual method for text-based deserialization. Each string in the list typically represents one line of input data.

Note
Format and parsing rules are determined by the derived class

Reimplemented from Interface.

Definition at line 328 of file elemental_profile_set.cpp.

◆ ReadFromJsonObject() [1/2]

bool Elemental_Profile_Set::ReadFromJsonObject ( const QJsonObject & jsonobject)
overridevirtual

Deserialize object from JSON format.

Parameters
jsonobjectThe JSON object to read from
Returns
true if deserialization was successful, false otherwise

Pure virtual method for JSON deserialization. Derived classes must implement this to reconstruct their data structure from a JSON object.

Warning
Implementations should validate JSON structure and handle missing fields gracefully

Reimplemented from Interface.

Definition at line 298 of file elemental_profile_set.cpp.

References ReadFromJsonObject().

Referenced by Results::ReadFromJson(), and ReadFromJsonObject().

◆ ReadFromJsonObject() [2/2]

bool Elemental_Profile_Set::ReadFromJsonObject ( const QJsonObject & jsonobject,
QString & error )

Reads every profile, refusing any value that is not a finite number.

Parameters
errorSet to "sample 'S', constituent 'X': <reason>" if a value is refused
Returns
false if a value is refused

Definition at line 304 of file elemental_profile_set.cpp.

References AppendProfile(), and Elemental_Profile::ReadFromJsonObject().

◆ SelectTopElementsAggregate()

Elemental_Profile Elemental_Profile_Set::SelectTopElementsAggregate ( int n) const

Select top N elements across all samples (aggregate minimum).

Definition at line 970 of file elemental_profile_set.cpp.

References Elemental_Profile::AppendElement(), and CMBVector::Label().

Referenced by Conductor::ExecuteAutoSelect().

◆ SetContribution()

bool Elemental_Profile_Set::SetContribution ( const double & value)

◆ SetContributionSoftmax()

bool Elemental_Profile_Set::SetContributionSoftmax ( const double & value)

Set softmax-transformed contribution.

Definition at line 1030 of file elemental_profile_set.cpp.

References contribution_softmax_, and x.

Referenced by SourceSinkData::SetContributionSoftmax().

◆ SetEstimatedMu()

bool Elemental_Profile_Set::SetEstimatedMu ( const string & element,
const double & value )

Set estimated mu parameter for an element.

◆ SetEstimatedSigma()

bool Elemental_Profile_Set::SetEstimatedSigma ( const string & element,
const double & value )

Set estimated sigma parameter for an element.

References Elemental_Profile_Set(), and linear.

◆ SetRegressionModels() [1/2]

void Elemental_Profile_Set::SetRegressionModels ( const MultipleLinearRegressionSet * mlrset)

Set regression models (copy existing).

Definition at line 554 of file elemental_profile_set.cpp.

References mlr_vs_om_size_, and mlrset.

◆ SetRegressionModels() [2/2]

void Elemental_Profile_Set::SetRegressionModels ( const string & om,
const string & d,
regression_form form = regression_form::linear,
const double & p_value_threshold = 0.05 )

◆ toJsonObject()

QJsonObject Elemental_Profile_Set::toJsonObject ( ) const
overridevirtual

Serialize object to JSON format.

Returns
QJsonObject containing the serialized data

Pure virtual method for JSON serialization. Derived classes must implement this to convert their data structure to a JSON object suitable for saving to .json files or transmitting over network.

Note
The JSON structure is determined by the derived class

Reimplemented from Interface.

Definition at line 278 of file elemental_profile_set.cpp.

◆ ToMatrix()

CMBMatrix Elemental_Profile_Set::ToMatrix ( ) const

Convert to matrix format (samples × elements).

Definition at line 923 of file elemental_profile_set.cpp.

References GetElementNames(), and matrix.

◆ ToString()

string Elemental_Profile_Set::ToString ( ) const
overridevirtual

Convert object to string representation.

Returns
String representation of the object's data

Pure virtual method that must be implemented by derived classes to provide a human-readable string representation of their data. Typically used for text file export or debugging.

Note
Format is determined by the derived class implementation

Reimplemented from Interface.

Definition at line 237 of file elemental_profile_set.cpp.

References GetElementNames(), and string.

Referenced by writetofile().

◆ ToTable()

QTableWidget * Elemental_Profile_Set::ToTable ( )
overridevirtual

Create a Qt table widget representation of the data.

Returns
Pointer to a newly allocated QTableWidget displaying the data

Pure virtual method that creates a visual table representation of the object's data suitable for display in the Qt GUI. The returned widget is dynamically allocated and should be managed by Qt's parent-child ownership system.

Note
Caller does not need to delete the returned widget if added to a parent
Highlighting based on limit settings is applied if enabled

Reimplemented from Interface.

Definition at line 717 of file elemental_profile_set.cpp.

References GetElementNames(), Interface::highlightoutsideoflimit, Interface::highlimit, and Interface::lowlimit.

◆ UpdateElementDistributions()

void Elemental_Profile_Set::UpdateElementDistributions ( )

Rebuild element distributions from all profiles.

Call this after adding/modifying profiles to update statistical distributions

Definition at line 166 of file elemental_profile_set.cpp.

References element_distributions_.

Referenced by AppendProfiles(), and SourceSinkData::LumpAllProfileSets().

◆ writetofile()

bool Elemental_Profile_Set::writetofile ( QFile * file)
overridevirtual

Write object data to a file.

Parameters
filePointer to an open QFile object for writing
Returns
true if write was successful, false otherwise

Pure virtual method for file output. Derived classes implement this to write their data to an open file stream in their preferred text format.

Precondition
file must be opened in write mode
Note
File is not closed by this method

Reimplemented from Interface.

Definition at line 268 of file elemental_profile_set.cpp.

References ToString().

Member Data Documentation

◆ contribution_

double Elemental_Profile_Set::contribution_ = 0.0
private

Source contribution (for CMB).

Definition at line 409 of file elemental_profile_set.h.

Referenced by Elemental_Profile_Set(), Elemental_Profile_Set(), GetContribution(), operator=(), and SetContribution().

◆ contribution_softmax_

double Elemental_Profile_Set::contribution_softmax_ = 0.0
private

Softmax-transformed contribution.

Definition at line 410 of file elemental_profile_set.h.

Referenced by Elemental_Profile_Set(), Elemental_Profile_Set(), GetContributionSoftmax(), operator=(), and SetContributionSoftmax().

◆ element_distributions_

◆ mlr_vs_om_size_

◆ outlierdone_

bool Elemental_Profile_Set::outlierdone_ = false
private

Flag indicating outlier analysis performed.

Definition at line 411 of file elemental_profile_set.h.

Referenced by Elemental_Profile_Set(), Elemental_Profile_Set(), DetectOutliers(), operator=(), and OutlierAnalysisDone().


The documentation for this class was generated from the following files: