biosimulators_copasi package#

biosimulators_copasi.exec_sed_doc(doc: SedDocument | str, working_dir: str, base_out_path: str, rel_out_path: str | None = None, apply_xml_model_changes: bool = True, log: SedDocumentLog | None = None, indent: int = 0, pretty_print_modified_xml_models: bool = False, log_level: StandardOutputErrorCapturerLevel | None = StandardOutputErrorCapturerLevel.c, config: Config | None = None) Tuple[ReportResults, SedDocumentLog][source]#

Execute the tasks specified in a SED document and generate the specified outputs

Parameters:
  • doc (SedDocument or str) – SED document or a path to SED-ML file which defines a SED document

  • working_dir (str) – working directory of the SED document (path relative to which models are located)

  • base_out_path (str) –

    path to store the outputs

    • CSV: directory in which to save outputs to files {base_out_path}/{rel_out_path}/{report.id}.csv

    • HDF5: directory in which to save a single HDF5 file ({base_out_path}/reports.h5), with reports at keys {rel_out_path}/{report.id} within the HDF5 file

  • rel_out_path (str, optional) – path relative to base_out_path to store the outputs

  • apply_xml_model_changes (bool, optional) – if True, apply any model changes specified in the SED-ML file before calling task_executer.

  • log (SedDocumentLog, optional) – log of the document

  • indent (int, optional) – degree to indent status messages

  • pretty_print_modified_xml_models (bool, optional) – if True, pretty print modified XML models

  • log_level (StandardOutputErrorCapturerLevel, optional) – level at which to log output

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • ReportResults: results of each report

  • SedDocumentLog: log of the document

Return type:

tuple

biosimulators_copasi.exec_sed_task(task: Task, variables: List[Variable], preprocessed_task: Dict | None = None, log: TaskLog | None = None, config: Config | None = None) Tuple[VariableResults, TaskLog][source]#

Execute a task and save its results

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • preprocessed_task (dict, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.

  • log (TaskLog, optional) – log for the task

  • config (Config, optional) – BioSimulators common configuration

Returns:

VariableResults: results of variables TaskLog: log

Return type:

tuple

Raises:
  • ValueError – if the task or an aspect of the task is not valid, or the requested output variables could not be recorded

  • NotImplementedError – if the task is not of a supported type or involves an unsupported feature

biosimulators_copasi.exec_sedml_docs_in_combine_archive(archive_filename: str, out_dir: str, config: Config | None = None, fix_copasi_generated_combine_archive: bool | None = None) Tuple[SedDocumentResults, CombineArchiveLog][source]#

Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs

Parameters:
  • archive_filename (str) – path to COMBINE/OMEX archive

  • out_dir (str) –

    path to store the outputs of the archive

    • CSV: directory in which to save outputs to files { out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv

    • HDF5: directory in which to save a single HDF5 file ({ out_dir }/reports.h5), with reports at keys { relative-path-to-SED-ML-file-within-archive }/{ report.id } within the HDF5 file

  • config (Config, optional) – BioSimulators common configuration

  • should_fix_copasi_generated_combine_archive (bool, optional) – Whether to make COPASI-generated COMBINE archives compatible with the specifications of the OMEX manifest and SED-ML standards

Returns:

  • SedDocumentResults: results

  • CombineArchiveLog: log

Return type:

tuple

biosimulators_copasi.get_simulator_version()[source]#

Get the version of COPASI

Returns:

version

Return type:

str

biosimulators_copasi.preprocess_sed_task(task: Task, variables: list[Variable], config: Config | None = None) BasicoInitialization[source]#

Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of exec_sed_task.

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • config (Config, optional) – BioSimulators common configuration

Returns:

prepared information about the task

Return type:

BasicoInitialization

Submodules#

biosimulators_copasi.core module#

Methods for executing SED tasks in COMBINE archives and saving their outputs

Author:

Jonathan Karr <karr@mssm.edu>

Author:

Akhil Marupilla <akhilmteja@gmail.com>

Date:

2020-11-17

Copyright:

2020, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_copasi.core.exec_sed_doc(doc: SedDocument | str, working_dir: str, base_out_path: str, rel_out_path: str | None = None, apply_xml_model_changes: bool = True, log: SedDocumentLog | None = None, indent: int = 0, pretty_print_modified_xml_models: bool = False, log_level: StandardOutputErrorCapturerLevel | None = StandardOutputErrorCapturerLevel.c, config: Config | None = None) Tuple[ReportResults, SedDocumentLog][source]#

Execute the tasks specified in a SED document and generate the specified outputs

Parameters:
  • doc (SedDocument or str) – SED document or a path to SED-ML file which defines a SED document

  • working_dir (str) – working directory of the SED document (path relative to which models are located)

  • base_out_path (str) –

    path to store the outputs

    • CSV: directory in which to save outputs to files {base_out_path}/{rel_out_path}/{report.id}.csv

    • HDF5: directory in which to save a single HDF5 file ({base_out_path}/reports.h5), with reports at keys {rel_out_path}/{report.id} within the HDF5 file

  • rel_out_path (str, optional) – path relative to base_out_path to store the outputs

  • apply_xml_model_changes (bool, optional) – if True, apply any model changes specified in the SED-ML file before calling task_executer.

  • log (SedDocumentLog, optional) – log of the document

  • indent (int, optional) – degree to indent status messages

  • pretty_print_modified_xml_models (bool, optional) – if True, pretty print modified XML models

  • log_level (StandardOutputErrorCapturerLevel, optional) – level at which to log output

  • config (Config, optional) – BioSimulators common configuration

  • simulator_config (SimulatorConfig, optional) – tellurium configuration

Returns:

  • ReportResults: results of each report

  • SedDocumentLog: log of the document

Return type:

tuple

biosimulators_copasi.core.exec_sed_task(task: Task, variables: List[Variable], preprocessed_task: Dict | None = None, log: TaskLog | None = None, config: Config | None = None) Tuple[VariableResults, TaskLog][source]#

Execute a task and save its results

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • preprocessed_task (dict, optional) – preprocessed information about the task, including possible model changes and variables. This can be used to avoid repeatedly executing the same initialization for repeated calls to this method.

  • log (TaskLog, optional) – log for the task

  • config (Config, optional) – BioSimulators common configuration

Returns:

VariableResults: results of variables TaskLog: log

Return type:

tuple

Raises:
  • ValueError – if the task or an aspect of the task is not valid, or the requested output variables could not be recorded

  • NotImplementedError – if the task is not of a supported type or involves an unsupported feature

biosimulators_copasi.core.exec_sedml_docs_in_combine_archive(archive_filename: str, out_dir: str, config: Config | None = None, fix_copasi_generated_combine_archive: bool | None = None) Tuple[SedDocumentResults, CombineArchiveLog][source]#

Execute the SED tasks defined in a COMBINE/OMEX archive and save the outputs

Parameters:
  • archive_filename (str) – path to COMBINE/OMEX archive

  • out_dir (str) –

    path to store the outputs of the archive

    • CSV: directory in which to save outputs to files { out_dir }/{ relative-path-to-SED-ML-file-within-archive }/{ report.id }.csv

    • HDF5: directory in which to save a single HDF5 file ({ out_dir }/reports.h5), with reports at keys { relative-path-to-SED-ML-file-within-archive }/{ report.id } within the HDF5 file

  • config (Config, optional) – BioSimulators common configuration

  • should_fix_copasi_generated_combine_archive (bool, optional) – Whether to make COPASI-generated COMBINE archives compatible with the specifications of the OMEX manifest and SED-ML standards

Returns:

  • SedDocumentResults: results

  • CombineArchiveLog: log

Return type:

tuple

biosimulators_copasi.core.get_simulator_version()[source]#

Get the version of COPASI

Returns:

version

Return type:

str

biosimulators_copasi.core.preprocess_sed_task(task: Task, variables: list[Variable], config: Config | None = None) BasicoInitialization[source]#

Preprocess a SED task, including its possible model changes and variables. This is useful for avoiding repeatedly initializing tasks on repeated calls of exec_sed_task.

Parameters:
  • task (Task) – task

  • variables (list of Variable) – variables that should be recorded

  • config (Config, optional) – BioSimulators common configuration

Returns:

prepared information about the task

Return type:

BasicoInitialization

biosimulators_copasi.data_model module#

Data model for maps from KiSAO terms to COPASI algorithms and their arguments

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2020-12-13

Copyright:

2020, BioSimulators Team

License:

MIT

class biosimulators_copasi.data_model.AbsoluteToleranceParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'a_tol'[source]#
KISAO_ID: str = 'KISAO_0000211'[source]#
NAME: str = 'Absolute Tolerance'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.AdaptiveSSATauLeapAlgorithm(max_internal_steps: int | None = None, random_seed: int | None = None, epsilon: float | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'adaptivesa'[source]#
KISAO_ID: str = 'KISAO_0000048'[source]#
NAME: str = 'Stochastic (Adaptive SSA/τ-Leap)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.CopasiAlgorithm[source]#

Bases: object

CAN_SUPPORT_EVENTS: bool[source]#
ID: CopasiAlgorithmType[source]#
KISAO_ID: str[source]#
NAME: str[source]#
get_copasi_id() str[source]#
get_method_settings() dict[str, str][source]#
get_overrides() dict[source]#
get_parameters_by_kisao() dict[str, CopasiAlgorithmParameter][source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.CopasiAlgorithmParameter[source]#

Bases: object

ID: str[source]#
KISAO_ID: str[source]#
NAME: str[source]#
get_override_repr() dict[source]#
get_value() int | str | float | bool | list[source]#
static get_value_type(cls: CopasiAlgorithmParameter)[source]#
set_value(new_value: int | str | float | bool | list)[source]#
class biosimulators_copasi.data_model.CopasiAlgorithmType(value)[source]#

Bases: Enum

An enumeration.

ADAPTIVE_SSA_TAU_LEAP = <class 'biosimulators_copasi.data_model.AdaptiveSSATauLeapAlgorithm'>[source]#
DIRECT_METHOD = <class 'biosimulators_copasi.data_model.DirectMethodAlgorithm'>[source]#
GIBSON_BRUCK = <class 'biosimulators_copasi.data_model.GibsonBruckAlgorithm'>[source]#
HYBRID_LSODA = <class 'biosimulators_copasi.data_model.HybridLsodaAlgorithm'>[source]#
HYBRID_RK45 = <class 'biosimulators_copasi.data_model.HybridRK45Algorithm'>[source]#
HYBRID_RUNGE_KUTTA = <class 'biosimulators_copasi.data_model.HybridRungeKuttaAlgorithm'>[source]#
LSODA = <class 'biosimulators_copasi.data_model.LsodaAlgorithm'>[source]#
RADAU5 = <class 'biosimulators_copasi.data_model.Radau5Algorithm'>[source]#
SDE_SOLVE_RI5 = <class 'biosimulators_copasi.data_model.SDESolveRI5Algorithm'>[source]#
TAU_LEAP = <class 'biosimulators_copasi.data_model.TauLeapAlgorithm'>[source]#
class biosimulators_copasi.data_model.DeterministicReactionsParameter(value: list | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'deterministic_reactions'[source]#
KISAO_ID: str = 'KISAO_0000534'[source]#
NAME: str = 'Deterministic Reactions'[source]#
get_value() list[source]#
set_value(new_value: list)[source]#
class biosimulators_copasi.data_model.DirectMethodAlgorithm(max_internal_steps: int | None = None, random_seed: int | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'directmethod'[source]#
KISAO_ID: str = 'KISAO_0000029'[source]#
NAME: str = 'Stochastic (Direct method)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.EpsilonParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'epsilon'[source]#
KISAO_ID: str = 'KISAO_0000228'[source]#
NAME: str = 'Epsilon'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.ForcePhysicalCorrectnessParameter(value: bool | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'force_physical_correctness'[source]#
KISAO_ID: str = 'KISAO_0000567'[source]#
NAME: str = 'Force Physical Correctness'[source]#
get_value() bool[source]#
set_value(new_value: bool)[source]#
class biosimulators_copasi.data_model.GibsonBruckAlgorithm(max_internal_steps: int | None = None, random_seed: int | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'stochastic'[source]#
KISAO_ID: str = 'KISAO_0000027'[source]#
NAME: str = 'Stochastic (Gibson + Bruck)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.HybridLsodaAlgorithm(relative_tolerance: float | None = None, absolute_tolerance: float | None = None, integrate_reduced_model: bool | None = None, max_internal_steps: int | None = None, max_internal_step_size: float | None = None, random_seed: int | None = None, lower_limit: float | None = None, upper_limit: float | None = None, partitioning_interval: float | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = False[source]#
ID: str = 'hybridlsoda'[source]#
KISAO_ID: str = 'KISAO_0000562'[source]#
NAME: str = 'Hybrid (LSODA)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.HybridRK45Algorithm(relative_tolerance: float | None = None, absolute_tolerance: float | None = None, max_internal_steps: int | None = None, random_seed: int | None = None, deterministic_reactions: list | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'hybridode45'[source]#
KISAO_ID: str = 'KISAO_0000563'[source]#
NAME: str = 'Hybrid (RK-45)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.HybridRungeKuttaAlgorithm(max_internal_steps: int | None = None, random_seed: int | None = None, lower_limit: float | None = None, upper_limit: float | None = None, step_size: float | None = None, partitioning_interval: float | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = False[source]#
ID: str = 'hybrid'[source]#
KISAO_ID: str = 'KISAO_0000561'[source]#
NAME: str = 'Hybrid (Runge-Kutta)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.InitialStepSizeParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'init_step_size'[source]#
KISAO_ID: str = 'KISAO_0000559'[source]#
NAME: str = 'Initial Step Size'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.IntegrateReducedModelParameter(value: bool | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'irm'[source]#
KISAO_ID: str = 'KISAO_0000216'[source]#
NAME: str = 'Integrate Reduced Model'[source]#
get_value() bool[source]#
set_value(new_value: bool)[source]#
class biosimulators_copasi.data_model.InternalStepParameter(value: float | None = None)[source]#

Bases: StepSizeParameter

ID: str = 'internal_step_size'[source]#
NAME: str = 'Internal Steps Size'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.LowerLimitParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'lower_lim'[source]#
KISAO_ID: str = 'KISAO_0000203'[source]#
NAME: str = 'Lower Limit'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.LsodaAlgorithm(relative_tolerance: float | None = None, absolute_tolerance: float | None = None, integrate_reduced_model: bool | None = None, max_internal_steps: int | None = None, max_internal_step_size: float | None = None, units: Units = Units.continuous)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'lsoda'[source]#
KISAO_ID: str = 'KISAO_0000560'[source]#
NAME: str = 'Deterministic (LSODA)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.MaximumInternalStepSizeParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'max_step_size'[source]#
KISAO_ID: str = 'KISAO_0000467'[source]#
NAME: str = 'Max Internal Step Size'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.MaximumInternalStepsParameter(value: int | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'max_steps'[source]#
KISAO_ID: str = 'KISAO_0000415'[source]#
NAME: str = 'Max Internal Steps'[source]#
get_value() int[source]#
set_value(new_value: int)[source]#
class biosimulators_copasi.data_model.PartitioningIntervalParameter(value: int | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'partitioning_interval'[source]#
KISAO_ID: str = 'KISAO_0000205'[source]#
NAME: str = 'Partitioning Interval'[source]#
get_value() int[source]#
set_value(new_value: int)[source]#
class biosimulators_copasi.data_model.Radau5Algorithm(relative_tolerance: float | None = None, absolute_tolerance: float | None = None, integrate_reduced_model: bool | None = None, max_internal_steps: int | None = None, initial_step_size: float | None = None, units: Units = Units.continuous)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = False[source]#
ID: str = 'radau5'[source]#
KISAO_ID: str = 'KISAO_0000304'[source]#
NAME: str = 'Deterministic (RADAU5)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.RandomSeedParameter(value: int | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'random_seed'[source]#
KISAO_ID: str = 'KISAO_0000488'[source]#
NAME: str = 'Random Seed'[source]#
get_override_repr() dict[source]#
get_value() int[source]#
set_value(new_value: int)[source]#
class biosimulators_copasi.data_model.RelativeToleranceParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'r_tol'[source]#
KISAO_ID: str = 'KISAO_0000209'[source]#
NAME: str = 'Relative Tolerance'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.RungeKuttaStepSizeParameter(value: float | None = None)[source]#

Bases: StepSizeParameter

ID: str = 'rk_step_size'[source]#
NAME: str = 'Runge Kutta Stepsize'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.SDESolveRI5Algorithm(absolute_tolerance: float | None = None, max_internal_steps: int | None = None, step_size: float | None = None, tolerance_for_root_finder: float | None = None, force_physical_correctness: bool | None = None, units: Units = Units.continuous)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = True[source]#
ID: str = 'sde'[source]#
KISAO_ID: str = 'KISAO_0000566'[source]#
NAME: str = 'SDE Solver (RI5)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.StepSizeParameter[source]#

Bases: CopasiAlgorithmParameter

ID: str = None[source]#
KISAO_ID: str = 'KISAO_0000483'[source]#
NAME: str = None[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.TauLeapAlgorithm(max_internal_steps: int | None = None, random_seed: int | None = None, epsilon: float | None = None, units: Units = Units.discrete)[source]#

Bases: CopasiAlgorithm

CAN_SUPPORT_EVENTS: bool = False[source]#
ID: str = 'tauleap'[source]#
KISAO_ID: str = 'KISAO_0000039'[source]#
NAME: str = 'Stochastic (τ-Leap)'[source]#
get_copasi_id() str[source]#
get_overrides() dict[source]#
get_unit_set() Units[source]#
class biosimulators_copasi.data_model.ToleranceForRootFinderParameter(value: float)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'root_finder_tolerance'[source]#
KISAO_ID: str = 'KISAO_0000565'[source]#
NAME: str = 'Tolerance for Root Finder'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#
class biosimulators_copasi.data_model.Units(value)[source]#

Bases: str, Enum

Function for getting simulation results

__format__(format_spec)[source]#

Returns format using actual value type unless __str__ has been overridden.

continuous = 'continuous'[source]#
discrete = 'discrete'[source]#
class biosimulators_copasi.data_model.UpperLimitParameter(value: float | None = None)[source]#

Bases: CopasiAlgorithmParameter

ID: str = 'upper_lim'[source]#
KISAO_ID: str = 'KISAO_0000204'[source]#
NAME: str = 'Upper Limit'[source]#
get_value() float[source]#
set_value(new_value: float)[source]#

biosimulators_copasi.utils module#

Utilities for working with the maps from KiSAO ids to COPASI methods and their arguments

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2020-12-13

Copyright:

2020, BioSimulators Team

License:

MIT

biosimulators_copasi.utils.convert_sedml_reactions_to_copasi_reactions(sedml_reactions: list[str]) list[str][source]#
biosimulators_copasi.utils.fix_copasi_generated_combine_archive(in_filename: str, out_filename: str, config: Config | None = None) None[source]#

Utility function that corrects COMBINE/OMEX archives generated by COPASI so they are compatible with other tools.

All currently released versions of COPASI export COMBINE archive files. However, these archives presently diverge from the specifications of the SED-ML format.

  • Format in OMEX manifests is not a valid PURL media type URI

  • SED-ML files lack namespaces for SBML

Parameters:
  • in_filename (str) – path to a COMBINE archive to correct

  • out_filename (str) – path to save corrected COMBINE archive

  • config (Config, optional) – BioSimulators-utils configuration

biosimulators_copasi.utils.get_algorithm(kisao_id: str, events_were_requested: bool = False, config: Config | None = None) CopasiAlgorithm[source]#

Get the algorithm wrapper for a COPASI algorithm

Parameters:
  • kisao_id (str) – KiSAO algorithm id

  • events_were_requested (bool, optional) – whether an algorithm that supports events is needed

  • config (Config, optional) – configuration

Returns:

The copasi algorithm deemed suitable

Return type:

CopasiAlgorithm

biosimulators_copasi.utils.set_algorithm_parameter_values(copasi_algorithm: CopasiAlgorithm, requested_changes: list) tuple[list[AlgorithmParameterChange], list[AlgorithmParameterChange]][source]#

Set a parameter of a COPASI simulation function

Parameters:
  • algorithm_kisao_id (str) – KiSAO algorithm id

  • algorithm_function (types.FunctionType) – algorithm function

  • parameter_kisao_id (str) – KiSAO parameter id

  • value (string) – parameter value

Returns:

names of the COPASI parameters that were set and their values

Return type:

dict