Measurement Data Plots

Measurement data plots in chi are primarily intended to illustrate measurements of pharmacokinetic or pharmacodynamic biomarkers from different individuals or patients over time.

However, simple MechanisticModel simulations may also be added to the figure. This is ideally suited to explore the dynamic properties of a given model for a number of parameter values and compare them to preclinical or clinical data.

Functional classes

Detailed API

class chi.plots.PDTimeSeriesPlot(updatemenu=True)[source]

A figure class that visualises measurements of a pharmacodynamic observables across multiple individuals.

Measurements of a pharmacodynamic observables over time are visualised as a scatter plot.

Extends SingleFigure.

Parameters:

updatemenu – Boolean flag that enables or disables interactive buttons, such as a logarithmic scale switch for the y-axis.

add_data(data, observable=None, id_key='ID', time_key='Time', obs_key='Observable', value_key='Value')[source]

Adds pharmacodynamic time series data of (multiple) individuals to the figure.

Expects a pandas.DataFrame with an ID, a time, an observable and a value column, and adds a scatter plot of the measuremed time series to the figure. Each individual receives a unique colour.

Parameters:
  • data – A pandas.DataFrame with the time series PD data in form of an ID, time, and observable column.

  • observable – The measured bimoarker. This argument is used to determine the relevant rows in the dataframe. If None, the first observable in the observable column is selected.

  • id_key – Key label of the DataFrame which specifies the ID column. The ID refers to the identity of an individual. Defaults to 'ID'.

  • time_key – Key label of the DataFrame which specifies the time column. Defaults to 'Time'.

  • obs_key – Key label of the DataFrame which specifies the observable column. Defaults to 'Observable'.

  • value_key – Key label of the DataFrame which specifies the column of the measured values. Defaults to 'Value'.

add_simulation(data, time_key='Time', value_key='Value')[source]

Adds a pharmacodynamic time series simulation to the figure.

Expects a pandas.DataFrame with a time and a value column, and adds a line plot of the simulated time series to the figure.

Parameters:
  • data – A pandas.DataFrame with the time series PD simulation in form of a time and value column.

  • time_key – Key label of the DataFrame which specifies the time column. Defaults to 'Time'.

  • value_key – Key label of the DataFrame which specifies the value column. Defaults to 'Value'.

set_axis_labels(xlabel, ylabel)

Sets the x axis, and y axis label of the figure.

show()

Displays the figure.

class chi.plots.PKTimeSeriesPlot(updatemenu=True)[source]

A figure class that visualises measurements of a pharmacokinetic observable across multiple individuals.

Measurements of a pharmacokinetic observable over time are visualised as a scatter plot.

Extends SingleSubplotFigure.

Parameters:

updatemenu – Boolean flag that enables or disables interactive buttons, such as a logarithmic scale switch for the y-axis.

add_data(data, observable=None, id_key='ID', time_key='Time', obs_key='Observable', value_key='Value', dose_key='Dose', dose_duration_key='Duration')[source]

Adds pharmacokinetic time series data of (multiple) individuals to the figure.

Expects a pandas.DataFrame with an ID, a time, an observable and a value column, and adds a scatter plot of the measuremed time series to the figure. The dataframe is also expected to have information about the administered dose via a dose and a dose duration column. Each individual receives a unique colour.

Parameters:
  • data – A pandas.DataFrame with the time series PD data in form of an ID, time, observable and value column.

  • observable – The measured bimoarker. This argument is used to determine the relevant rows in the dataframe. If None, the first observable in the observable column is selected.

  • id_key – Key label of the DataFrame which specifies the ID column. The ID refers to the identity of an individual. Defaults to 'ID'.

  • time_key – Key label of the DataFrame which specifies the time column. Defaults to 'Time'.

  • obs_key – Key label of the DataFrame which specifies the observable column. Defaults to 'Observable'.

  • value_key – Key label of the DataFrame which specifies the column of the measured values. Defaults to 'Value'.

  • dose_key – Key label of the DataFrame which specifies the dose column. Defaults to 'Dose'.

  • dose_duration_key – Key label of the DataFrame which specifies the dose duration column. Defaults to 'Duration'.

add_simulation(data, time_key='Time', value_key='Value', dose_key='Dose')[source]

Adds a pharmacokinetic time series simulation to the figure.

Expects a pandas.DataFrame with a time, a value, and a dose column. A line plot of the biomarker time series, as well as the dosing regimen is added to the figure.

Parameters:
  • data – A pandas.DataFrame with the time series PD simulation in form of a time and a value column.

  • time_key – Key label of the DataFrame which specifies the time column. Defaults to 'Time'.

  • value_key – Key label of the DataFrame which specifies the simulated values column. Defaults to 'Value'.

set_axis_labels(time_label, biom_label, dose_label)[source]

Sets the label of the time axis, the biomarker axis, and the dose axis.

show()

Displays the figure.