itcsimlib.itc_sim module

Essential simulator for generating or fitting data with binding models.

class itcsimlib.itc_sim.ITCSim(T0=298.15, units='J', verbose=False, threads=0)[source]

Bases: object

This core class evaluates binding models against experimental data.

chisq

The average reduced chi squared goodness-of-fit across the experiments in the simulator.

Type:dict of floats
experiments

The list of experiments in the simulation. Do not directly modify this list, use the add and remove experiment class methods.

Type:list of ITCExperiments
model

The model used by the simulator to generate/fit data.

Type:ITCModel
get_experiment_by_title(title)[source]

Return the named experiment from simulation.

Parameters:title (string) – The title (name) of the experiment to return.
Returns:The requested experiment
Return type:ITCExperiment
get_model_param(name, units=None)[source]

Return the value of the named simulation model parameter.

Parameters:
  • name (string) – The name of the model parameter.
  • units (string) – The units to use (if different than the specified model units to use, if applicable).
Returns:

The requested model parameter value.

Return type:

float

get_model_params(units=None)[source]

Return all the parameter values of the current simulation model.

Parameters:units (string) – The units to use (if different than the specified model units to use, if applicable).
Returns:The requested model parameter values.
Return type:dict of floats
get_chisq()[source]

Return the total reduced chisquared goodness-of-fit for the simulator.

Parameters:None
Returns:The (total chisq / # experiments) between the experimental data and the model, if they exist.
Return type:float
set_model(model)[source]

Set the model for the simulator to use.

Parameters:model (ITCModel) – The model to use for the simulator.
Returns:
Return type:None
set_model_params(*args, **kwargs)[source]

Passthrough for the simulator’s model set_params()

set_model_param(param, value)[source]

Passthrough for the simulator’s model set_param()

done()[source]

Cleanly shuts down the simulator.

Parameters:None
Returns:
Return type:None
add_experiment(experiment)[source]

Add a pre-defined experiment to the simulator.

Parameters:experiment (ITCExperiment) – The experiment to add.
Returns:
Return type:None
add_experiment_synthetic(*args, **kwargs)[source]

Add a set of synthetic experimental conditions to the simulator.

Parameters:
  • *args – Positional arguments for ITCExperimentSynthetic constructor
  • **kwargs – Keyword arguments for ITCExperimentSynthetic constructor
Returns:

The experiment created and added to the simulator.

Return type:

ITCExperiment

add_experiment_file(file, **kwargs)[source]

Add an experiment present in a file to the simulator.

Parameters:
  • file (string) – Path to the experiment file.
  • **kwargs – Keyword arguments to the ITCExperiment constructor, can be used to overwrite any file-defined arguments.
Returns:

The experiment created and added to the simulator.

Return type:

ITCExperiment

remove_experiment(experiment)[source]

Remove an experiment from the simulator.

Parameters:experiment (ITCExperiment) – The experiment to remove.
Returns:
Return type:None
remove_all_experiments()[source]

Removes all experiments from the simulator.

Parameters:None
Returns:
Return type:None
make_plots(indices=None, **kwargs)[source]

Call the make_plot() methods of simulator experiments.

Parameters:
  • indices (list of ints) – If provided, generate only plots for the specified experimental indices. Otherwise, generate plots for all experiments.
  • **kwargs – Keyword arguments for the ITCExperiment make_plot() method.
Returns:

Return type:

None

export_data(indices=None, **kwargs)[source]

Call the export_data() methods of simulator experiments.

Parameters:
  • indices (list of ints) – If provided, generate exported files for the specified experimental indices. Otherwise, generate exports for all experiments.
  • **kwargs – Keyword arguments for the ITCExperiment export_data() method.
Returns:

Return type:

None

run(experiments=None, writeback=True)[source]

Using the current model parameters, generate fits for either the specified experiments, and return the average reduced chi-squared goodness-of-fit.

Parameters:
  • experiments (list of ITCExperiments) – The experiments to run through the simulator. If None, run all experiments in the simulator.
  • writeback (boolean) – Update the dQ_fits of the experiments in the simulator?
Returns:

The average reduced chi-squared goodness-of-fit across the experiments.

Return type:

float