IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::saxs::ProfileFitter< ScoringFunctionT > Class Template Reference

Fit two profiles with user-defined scoring function as a template parameter. More...

#include <IMP/saxs/ProfileFitter.h>

Inheritance diagram for IMP::saxs::ProfileFitter< ScoringFunctionT >:

Detailed Description

template<typename ScoringFunctionT = ChiScore>
class IMP::saxs::ProfileFitter< ScoringFunctionT >

Fit two profiles with user-defined scoring function as a template parameter.

By default chi score is used. The scoring function template parameter class has to implement three basic functions: compute_score, compute_scale_factor and compute_offset. see ChiScore for example. Currently four scoring functions are implemented: ChiScore, ChiScoreLog, ChiFreeScore, and RatioVolatilityScore

Definition at line 29 of file ProfileFitter.h.

Public Member Functions

 ProfileFitter (const Profile *exp_profile)
 Constructor.
 ProfileFitter (const Profile *exp_profile, ScoringFunctionT *sf)
double compute_offset (const Profile *model_profile) const
 computes offset for fitting for fitting the modeled profile
double compute_scale_factor (const Profile *model_profile, double offset=0.0) const
 computes the scaling factor needed for fitting the modeled profile
double compute_score (const Profile *model_profile, bool use_offset=false, const std::string fit_file_name="") const
 compute fit score
FitParameters fit_profile (Profile *partial_profile, double min_c1=0.95, double max_c1=1.05, double min_c2=-2.0, double max_c2=4.0, bool use_offset=false, const std::string fit_file_name="") const
 fit experimental profile through optimization of c1 and c2 parameters
const Profile * get_profile () const
void resample (const Profile *model_profile, Profile *resampled_profile) const
 resampling of the modeled profile is required to fit the q
void write_SAXS_fit_file (const std::string &file_name, const Profile *model_profile, const double chi_square, const double c=1, const double offset=0) const
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
LogLevel get_log_level () const
virtual VersionInfo get_version_info () const
 Get information about the module and version of the object.
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
virtual std::string get_type_name () const
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Protected Attributes

PointerMember< const Profile > exp_profile_
PointerMember< ScoringFunctionT > scoring_function_

Additional Inherited Members

Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Constructor & Destructor Documentation

◆ ProfileFitter() [1/2]

template<typename ScoringFunctionT = ChiScore>
IMP::saxs::ProfileFitter< ScoringFunctionT >::ProfileFitter ( const Profile * exp_profile)

Constructor.

Parameters
[in]exp_profileExperimental profile we want to fit

Definition at line 35 of file ProfileFitter.h.

Here is the call graph for this function:

◆ ProfileFitter() [2/2]

template<typename ScoringFunctionT = ChiScore>
IMP::saxs::ProfileFitter< ScoringFunctionT >::ProfileFitter ( const Profile * exp_profile,
ScoringFunctionT * sf )

Definition at line 41 of file ProfileFitter.h.

Member Function Documentation

◆ compute_offset()

template<typename ScoringFunctionT = ChiScore>
double IMP::saxs::ProfileFitter< ScoringFunctionT >::compute_offset ( const Profile * model_profile) const

computes offset for fitting for fitting the modeled profile

resampling of the modeled profile is required prior to calling to this function, in order to match the q values of the exp. profile. this is not done by default to minimize the number of calls to resample.

Definition at line 88 of file ProfileFitter.h.

◆ compute_scale_factor()

template<typename ScoringFunctionT = ChiScore>
double IMP::saxs::ProfileFitter< ScoringFunctionT >::compute_scale_factor ( const Profile * model_profile,
double offset = 0.0 ) const

computes the scaling factor needed for fitting the modeled profile

resampling of the modeled profile is required prior to calling to this function, in order to match the q values of the exp. profile. this is not done by default to minimize the number of calls to resample.

Definition at line 76 of file ProfileFitter.h.

◆ compute_score()

template<typename ScoringFunctionT>
double IMP::saxs::ProfileFitter< ScoringFunctionT >::compute_score ( const Profile * model_profile,
bool use_offset = false,
const std::string fit_file_name = "" ) const

compute fit score

Definition at line 205 of file ProfileFitter.h.

Here is the call graph for this function:

◆ fit_profile()

template<typename ScoringFunctionT>
FitParameters IMP::saxs::ProfileFitter< ScoringFunctionT >::fit_profile ( Profile * partial_profile,
double min_c1 = 0.95,
double max_c1 = 1.05,
double min_c2 = -2.0,
double max_c2 = 4.0,
bool use_offset = false,
const std::string fit_file_name = "" ) const

fit experimental profile through optimization of c1 and c2 parameters

c1 - adjusts the excluded volume, valid range [0.95 - 1.05] c2 - adjusts the density of hydration layer, valid range [-2.0 - 4.0]

Parameters
[in]partial_profilepartial profiles computed
[in]min_c1minimal c1 value
[in]max_c1maximal c1 value
[in]min_c2minimal c2 value
[in]max_c2maximal c2 value
[in]use_offsetuse offset in fitting
[in]fit_file_namewrite fit in the given filename, nothing is written if empty
Returns
FitParameters (score, c1, c2)

Definition at line 181 of file ProfileFitter.h.

Here is the call graph for this function:

◆ get_profile()

template<typename ScoringFunctionT = ChiScore>
const Profile * IMP::saxs::ProfileFitter< ScoringFunctionT >::get_profile ( ) const
Returns
the profile used

Definition at line 102 of file ProfileFitter.h.

◆ resample()

template<typename ScoringFunctionT>
void IMP::saxs::ProfileFitter< ScoringFunctionT >::resample ( const Profile * model_profile,
Profile * resampled_profile ) const

resampling of the modeled profile is required to fit the q

Definition at line 119 of file ProfileFitter.h.

Here is the call graph for this function:

◆ write_SAXS_fit_file()

template<typename ScoringFunctionT>
void IMP::saxs::ProfileFitter< ScoringFunctionT >::write_SAXS_fit_file ( const std::string & file_name,
const Profile * model_profile,
const double chi_square,
const double c = 1,
const double offset = 0 ) const

Definition at line 230 of file ProfileFitter.h.

Member Data Documentation

◆ exp_profile_

template<typename ScoringFunctionT = ChiScore>
PointerMember<const Profile> IMP::saxs::ProfileFitter< ScoringFunctionT >::exp_profile_
protected

Definition at line 114 of file ProfileFitter.h.

◆ scoring_function_

template<typename ScoringFunctionT = ChiScore>
PointerMember<ScoringFunctionT> IMP::saxs::ProfileFitter< ScoringFunctionT >::scoring_function_
protected

Definition at line 115 of file ProfileFitter.h.


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