mcp-pykingenie

v1.1.11
mcp-pykingenie Checked 5 hours ago Published 11 days ago

MCP_PYKINGENIE is a MCP server that provides tools for the analysis of binding kinetics data.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

print_data_dir

Print the path to the data directory, where the generated files will be stored. Returns ------- str The path to the data directory.

list_files_in_folder

List all files in the selected folder. Parameters ---------- folder : str The folder to list files from. Returns ------- list A list of file names in the data directory.

ParameterTypeDescription
folderstring

import_kingenie_surface_csv

Import a KinGenie surface-simulation CSV into the analyzer. The CSV is parsed with :class:`pykingenie.KinGenieCsv`. It should contain exported surface-simulation columns such as ``Time``, ``Signal``, ``Smax``, and ``Analyte_concentration_micromolar_constant``; a ``Cycle`` column is supported for single-cycle data. If ``exp_name`` already exists, a numeric suffix is appended before storing the experiment in ``PY_KINETICS``. Parameters ---------- csv : str Absolute path or ``DATA_DIR``-relative path to the simulation CSV file. exp_name : str…

ParameterTypeDescription
csv *string
exp_namestring

detect_data_format

Report the binding-data format of each file, without importing anything. Call this before ``import_binding_data`` on unfamiliar files, to know which import settings are needed. Formats: ``octet_frd``/``octet_fmf`` (Octet BLI), ``gator_zip``/``gator_steps``/``gator_settings``/``gator_csv`` (Gator BLI), ``biacore_blr`` (Biacore result file), ``spr_text`` (paired ``_X``/``_Y`` column SPR export, e.g. Biacore or Reichert text), ``carterra_csv`` (Carterra ``Label, X1, Y1, ...`` export), ``surface_csv_steps``/``surface_csv_traces`` (generic steps table plus trac…

ParameterTypeDescription
paths *

read_info_sheet

Read an info sheet (``.xlsx``, CSV or TSV). The sheet describes SPR runs: baseline, association and dissociation durations, analyte, ligand and molar concentrations, one row per sensor position. Pass its path as ``info_sheet`` to ``import_binding_data`` (and ``info_sheet_row`` when rows differ) to fill the timing and concentrations that SPR text and Carterra exports lack. ``Association_skip_s`` is a good ``trim_time`` for ``initiate_fitting_datasets``. Parameters ---------- path : str Absolute path or data-directory-relative path of the sheet.…

ParameterTypeDescription
path *string

import_binding_data

Import one surface-based binding experiment, detecting its file format. Supports Octet (folder of ``.frd`` files), Gator (folder or ``.zip``), Biacore result files (``.blr``), paired-column SPR text exports, Carterra CSV exports, a generic steps file plus traces file, and KinGenie CSVs. Use ``detect_data_format`` first if unsure. All files must belong to one experiment; folders are reduced to their files of a known format. Octet, Gator, Biacore and KinGenie files carry their own timing and concentrations: pass only ``paths`` and ``exp_name``. The other format…

ParameterTypeDescription
paths *
association_end
association_start
concentration_unit
concentrations
cycle_duration
dilution_factor
exp_name
highest_last
info_sheet
info_sheet_row
sample_id
single_cycle
time_unit
top_concentration

import_octet_experiment

Import an Octet experiment folder into the shared PyKinGenie analyzer. This wraps :class:`pykingenie.OctetExperiment`, loading sensor traces and sample plate metadata before adding the experiment to ``PY_KINETICS``. Parameters ---------- folder : str Absolute path or ``DATA_DIR``-relative folder containing Octet files. exp_name : str Name used when storing the experiment in the analyzer. Returns ------- str Confirmation message naming the imported folder.

ParameterTypeDescription
exp_namestring
folderstring

import_gator_experiment

Import Gator BLI data into the shared PyKinGenie analyzer. Folder contents are parsed with :class:`pykingenie.GatorExperiment`, which reads experiment steps, settings, and sensor-channel CSV traces. If a zip file is provided, it is extracted under ``DATA_DIR`` and then read as a folder. Parameters ---------- folder : str Absolute path or ``DATA_DIR``-relative folder or zip file containing ``Assay_#_Channel#.csv`` files plus ``Setting.ini`` and ``ExperimentStep.ini``. exp_name : str Name used when storing the experiment in t…

ParameterTypeDescription
exp_namestring
folderstring

load_octet_example

Load the packaged Octet example into the shared analyzer. The bundled BLI example is imported through the same :class:`pykingenie.OctetExperiment` path as ``import_octet_experiment`` and stored as ``"Example Experiment"``. Returns ------- str Confirmation message naming the packaged example folder.

get_legends_table

Build a plotting legend table from PyKinGenie sensor metadata. Sensor names and unique sensor IDs are collected with ``PY_KINETICS.get_experiment_properties`` and converted with :func:`pykingenie.get_plotting_df`. Returns ------- str JSON records for a DataFrame with ``Internal_ID``, ``Color``, ``Legend``, and ``Show`` columns.

list_experiment_names

Get the names of all experiments in the pykinetics analyzer. Returns ------- list A list of experiment names.

delete_experiment

Remove loaded experiments from the analyzer, e.g. a wrong import. All selectors are checked before anything is removed. Fitting datasets are built from the loaded experiments, so if any exist they are cleared too; run ``initiate_fitting_datasets`` again afterwards. Parameters ---------- experiment_ids : list[str] | str Experiment names or 1-based indices, as in ``list_experiment_names``. Returns ------- str The removed experiments and the ones still loaded.

ParameterTypeDescription
experiment_ids *

align_association

Align association phases for selected sensors in a PyKinGenie experiment. This calls ``SurfaceBasedExperiment.align_association``. PyKinGenie subtracts the signal before association from the selected traces and updates trace arrays, sensor names, and ligand metadata according to ``in_place`` and ``new_names``. Parameters ---------- experiment_id : str The name of the experiment to align. If a number is provided, it will be used to select the experiment by its index. sensor_names : list Sensor names to align. If empty, all sensors i…

ParameterTypeDescription
experiment_idstring
in_placeboolean
new_namesboolean
sensor_names

subtract_reference

Subtract a reference sensor from selected PyKinGenie sensor traces. This calls ``SurfaceBasedExperiment.subtraction`` and updates trace arrays, sensor names, and ligand metadata. The reference sensor may be named directly or selected by 1-based sensor index. Parameters ---------- experiment_id : str The name of the experiment to subtract the reference from. If a number is provided, it will be used to select the experiment by its index. list_of_sensor_names : list A list of sensor names to subtract the reference from. If no name…

ParameterTypeDescription
experiment_idstring
inplaceboolean
list_of_sensor_names
reference_sensorstring

average_sensors

Average signal values of selected sensors from a specific experiment Parameters ---------- experiment_id : str Name or 1-based index of the experiment to modify. list_of_sensor_names : list A list of sensor names to subtract the reference from. If no names are provided, all sensors will be used. sensor_output_name : str Name of the new sensor that contains the averaged traces Returns ------- str A confirmation message.

ParameterTypeDescription
experiment_idstring
list_of_sensor_names
sensor_output_namestring

delete_sensors

Delete sensor traces from a given experiment. Parameters ---------- experiment_id : str Name or 1-based index of the experiment to modify. list_of_sensor_names : list[str] | None Names of sensors to delete. If None, all sensors will be deleted. Returns ------- str Message describing the result.

ParameterTypeDescription
experiment_idstring
list_of_sensor_names

subtract_experiment

Subtract one surface-based experiment from another sensor by sensor. This calls ``SurfaceBasedExperiment.subtract_experiment`` on the selected target experiment. PyKinGenie sorts sensor names alphanumerically and subtracts each matching sensor trace from the reference experiment. Both experiments must have the same number of sensors and compatible time data. Parameters ---------- experiment_id : str Name or 1-based index of the experiment to modify. reference_experiment_id : str Name or 1-based index of the experiment to subtract from…

ParameterTypeDescription
experiment_idstring
inplaceboolean
reference_experiment_idstring

subtract_sensor_columns

Subtract one column of sensors from another in a surface experiment. This calls ``SurfaceBasedExperiment.subtraction_by_column``. PyKinGenie finds sensor names containing ``sensors_column_one`` and subtracts the corresponding sensor obtained by replacing that column number with ``sensors_column_two``. Parameters ---------- experiment_id : str Name or 1-based index of the experiment to modify. sensors_column_one : int Column number of the sensors to subtract from. sensors_column_two : int Column number of the reference sensors t…

ParameterTypeDescription
experiment_idstring
inplaceboolean
sensors_column_oneinteger
sensors_column_twointeger

inter_step_correction

Perform the inter-step correction by shifting the association phase in a PyKinGenie experiment. This process step assumes that the baseline and dissociation phases were carried out in the same well. Note: in the Octet software, this is called "Inter-Step Correction" with the option "Align data to Dissociation Step" This calls ``SurfaceBasedExperiment.assoc_inter_step_correction``. PyKinGenie moves the association traces to match the beginning of the dissociation phase. Parameters ---------- experiment_id : str The name of the experiment to align. If…

ParameterTypeDescription
experiment_idstring
in_placeboolean
new_namesboolean
npointsinteger
sensor_names

align_dissociation

Align dissociation phases for selected sensors in a PyKinGenie experiment. This calls ``SurfaceBasedExperiment.align_dissociation``. PyKinGenie shifts the dissociation traces to match the end of the association phase. Parameters ---------- experiment_id : str The name of the experiment to align. If a number is provided, it will be used to select the experiment by its index. sensor_names : list A list of sensor names to align. If no names are provided, all sensors in the experiment will be used. in_place : bool If True,…

ParameterTypeDescription
experiment_idstring
in_placeboolean
new_namesboolean
npointsinteger
sensor_names

obtain_sample_info_table

Return merged PyKinGenie sample metadata as JSON records. This calls ``PY_KINETICS.merge_ligand_conc_df`` across loaded experiments. The resulting table can be edited and passed to ``initiate_fitting_datasets`` to choose traces, concentrations, sample names, replicates, and Smax grouping. The ``Experiment`` column holds the names the experiments were loaded with, and is kept even when only one experiment is loaded, so a saved table stays tied to its data. Returns ------- str JSON records for the merged ligand-concentration DataFrame.

initiate_fitting_datasets

Generate PyKinGenie fitting objects from sample metadata JSON. A template for the JSON representation can be generated using the ``obtain_sample_info_table`` tool. The user can edit the JSON string to select only the data they want to fit, change analyte concentrations, change sample names, and alter Smax grouping. Without metadata, every trace in the default table is used. The metadata is checked before the existing fitting objects are reset, so invalid or ambiguous rows leave the current fits untouched. Unselected rows and zero-concentration references…

ParameterTypeDescription
sample_info
trim_timenumber

run_steady_state_fitting

Run PyKinGenie steady-state fitting for generated fitting datasets. This calls ``PY_KINETICS.submit_steady_state_fitting`` to fit concentration-response data independently from kinetic trace fitting. Existing kinetic fitting results are kept. Parameters ---------- steady_state_model : str Steady-state model to fit. PyKinGenie accepts ``'one_to_one'``, ``'two_to_one'`` and ``'two_to_one_heterogeneous_ligand'`` fit_sigma : bool If True with ``'two_to_one'`` steady-state fitting, fit the shared cooperativity factor sigma. Ret…

ParameterTypeDescription
fit_sigmaboolean
steady_state_modelstring

run_kinetics_fitting

Run PyKinGenie kinetic fitting for generated fitting datasets. This calculates the starting values required by PyKinGenie internally, then calls ``PY_KINETICS.submit_kinetics_fitting`` with the selected kinetic model, fitted region, Smax sharing setting, and optional two-site cooperativity setting. Use ``run_steady_state_fitting`` separately only when you want a standalone steady-state fit. Existing steady-state fitting results are kept. Inmediatly after the fitting, ask the user if they want to calculate erros by applying the leave-one-out method Pa…

ParameterTypeDescription
Kd1_valuesarray
Kd2_valuesarray
compute_k_obsboolean
fit_sigmaboolean
fit_signal_ratioboolean
fitting_modelstring
fitting_regionstring
linked_smaxboolean

calc_leave_one_out_errors

Calculate the errors of the fitted parameters, e.g., Kd and k_off, using the leave-one-out method. Briefly, for each fitting object (Sample ID), we do n-fits, where n is the total number of curves, leaving one curve out each time. Afterwards, the parameter value plus/minus error is available through get_leave_one_out_results

get_leave_one_out_results

Return PyKinGenie leave-one-out results as JSON records. Returns ------- str A JSON string representing the fitting results.

get_kinetics_fitting_results

Return PyKinGenie kinetic fitting results as JSON records. This calls ``PY_KINETICS.get_fitting_results`` and serializes ``fit_params_kinetics_all``, which contains fitted parameters such as Kd, k_off, k_on, and Smax when available. Returns ------- str A JSON string representing the fitting results.

get_fitting_parameters

Return the kinetic and steady-state fitted parameters as JSON records. Each record is one row of a dataset's ``fit_params_kinetics`` or ``fit_params_ss`` table, labeled with ``Fit type`` (``'Kinetics'`` or ``'Steady-state'``) and ``Dataset``. Missing numeric values are returned as null. This tool never runs a fit. Returns ------- list of dict Fitted parameter records, or an empty list before any fit.

get_correlation_matrices

Return the correlation matrices of the fitted parameters, one per fitting dataset. Correlations range from -1 to 1. Values near +/-1 mean two parameters trade off against each other: the data determine a combination of them, not each one separately, so their individual values should not be trusted. This tool never runs a fit. Parameters ---------- kind : str ``'kinetics'`` (default) for the latest kinetic fit, or ``'steady_state'`` for the latest steady-state fit. Returns ------- dict Keyed by dataset name. Each value has…

ParameterTypeDescription
kindstring

create_export_df

Return exported PyKinGenie association/dissociation traces as JSON records. This calls ``PY_KINETICS.create_export_df`` for all generated fitting objects. Raw export returns the measured association and dissociation signals; fitted export returns fitted curves after ``run_kinetics_fitting`` has been called. Parameters ---------- export_type : str Signal type to export. Accepts ``'raw'``, ``'fit'``, or ``'fitted'``. ``'fitted'`` is normalized to PyKinGenie's ``'fit'`` spelling. Returns ------- str JSON records for a DataFra…

ParameterTypeDescription
export_typestring

list_experiment_properties

Get a PyKinGenie property from all experiments or fittings. This is a direct wrapper around ``PY_KINETICS.get_experiment_properties``. Parameters ---------- variable : str The attribute to retrieve, e.g., ``'ligand_concentration'``, ``'sensor_names'``, etc. fittings : bool If True, returns attributes from the fitting objects instead of the experiments. Returns ------- list A list of values for the specified variable from the experiments or fittings.

ParameterTypeDescription
variable *string
fittingsboolean

list_experiment_attributes

Return all stored attributes for one PyKinGenie experiment. Run this tool only if the user asks for it specifically. Parameters ---------- experiment_name : str The name of the experiment to list attributes for. If a number is provided, it will be used to select the experiment by its index. Returns ------- dict A dictionary of experiment attributes.

ParameterTypeDescription
experiment_name *string

get_xy_plot_configs

Show the current settings used by the XY plotting tools. Fields set to ``None`` keep the defaults of each plot, for example the plot size or the axis labels. Returns ------- dict The plot, axis, layout, legend and trace configurations.

reset_xy_plot_configs

Reset every XY plotting configuration to the PyKinGenie defaults. Returns ------- str Confirmation message.

update_xy_plot_config

Edit the general settings of the XY plots. Only the provided parameters are changed; the others keep their current value. Use ``reset_xy_plot_configs`` to go back to the defaults. Parameters ---------- plot_width : int | None Width of the plot in pixels. plot_height : int | None Height of the plot in pixels. plot_type : str | None Format of the saved image: ``'png'``, ``'jpeg'``, ``'webp'``, ``'svg'`` or ``'pdf'``. font_size : float | None Font size of titles, axis labels and ticks. title : str | None Ma…

ParameterTypeDescription
font_size
palette
plot_height
plot_type
plot_width
title
x_range
y_range

update_xy_axis_config

Edit the axis settings of the XY plots. Only the provided parameters are changed; the others keep their current value. Parameters ---------- showgrid_x : bool | None If True, show the x-axis grid lines. showgrid_y : bool | None If True, show the y-axis grid lines. n_x_axis_ticks : int | None Approximate number of ticks on the x-axis. n_y_axis_ticks : int | None Approximate number of ticks on the y-axis. axis_linewidth : float | None Width of the axis lines in pixels. axis_tickwidth : float | None Wid…

ParameterTypeDescription
axis_gridwidth
axis_linewidth
axis_tickwidth
n_x_axis_ticks
n_y_axis_ticks
reverse_x
reverse_y
showgrid_x
showgrid_y
tick_length
x_bounds
x_label
x_scale
y_bounds
y_label
y_scale

update_xy_layout_config

Edit the subplot layout of the XY plots with several panels. Applies to ``plot_traces_with_all_steps``, ``plot_steady_state``, ``plot_kinetic_traces``, ``plot_steady_state_residuals`` and ``plot_kinetics_residuals``. Only the provided parameters are changed. Parameters ---------- stacked : bool | None If True, place all panels in a single column. ncols : int | None Number of panel columns. vertical_spacing : float | None Spacing between panel rows as a fraction of the plot height (0 to 1). gap : int | None Spacing betwe…

ParameterTypeDescription
extra_padding_y_label
gap
ncols
outer_labels
shared_xaxes
shared_yaxes
show_subplot_titles
split_by_smax_id
stacked
vertical_spacing

update_xy_legend_config

Edit the legend settings of the XY plots. Only the provided parameters are changed; the others keep their current value. Parameters ---------- show : bool | None If True, show the legend. loc : str | None Legend position, for example ``'upper right'`` or ``'lower left'``. ncols : int | None Number of legend columns. title : str | None Legend title. font_size : float | None Font size of the legend labels. toggle : bool | None If True, clicking a legend entry hides/shows it in the interactive HTML.…

ParameterTypeDescription
font_size
highlight
loc
ncols
show
title
toggle

update_xy_trace_config

Edit how data points and fitted curves are drawn in the XY plots. Only the provided parameters are changed; the others keep their current value. Parameters ---------- marker_size : float | None Size of the markers. Use 0 to hide them. line_width : float | None Width of the data lines. Use 0 to hide them. opacity : float | None Opacity of the data, between 0 and 1. fit_color : str | None Color of the fitted curves, e.g. ``'black'`` or ``'#FF5733'``. fit_line_width : float | None Width of the fitted curves. ex…

ParameterTypeDescription
exact_lines
fit_color
fit_line_width
line_width
marker_size
max_points
opacity
rolling_window
show_fit
smooth_curves

plot_sample_plate_info

Save an XY sample-plate layout plot for one experiment. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_plate_info` with the shared XY configurations, and saved in ``DATA_DIR`` using the format set in the plot configuration (``'png'`` by default). Parameters ---------- experiment_id : str The name or 1-based index of the experiment to plot. save_html : bool If True, also saves an interactive HTML file. Returns ------- str Message containing the saved image path.

ParameterTypeDescription
experiment_idstring
save_htmlboolean

plot_traces_with_all_steps

Save an XY plot with all loaded trace steps, one panel per experiment. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_traces_all` with the shared XY configurations. It includes baseline, loading, association, dissociation, and regeneration segments. Parameters ---------- legends_df : list[dict[str, Any]] | str | None Legend table records from ``get_legends_table``, with the columns ``Internal_ID``, ``Color``, ``Legend`` and ``Show``. Use ``Show`` to select the sensors to plot. If None, the default table is used. save_…

ParameterTypeDescription
legends_df
save_htmlboolean

plot_steady_state

Save an XY steady-state plot for the generated fitting datasets. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_steady_state` with the shared XY configurations. Requires ``initiate_fitting_datasets``. Fitted curves are shown unless ``show_fit`` was set to False with ``update_xy_trace_config``. Parameters ---------- save_html : bool If True, also saves an interactive HTML file. Returns ------- str Message containing the saved image path.

ParameterTypeDescription
save_htmlboolean

plot_kinetic_traces

Save an XY association/dissociation plot for the fitting datasets. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_association_dissociation` with the shared XY configurations. Requires ``initiate_fitting_datasets``. Traces are colored by ligand concentration (Viridis by default, or Blues with ``update_xy_plot_config(palette='blues')``), and fitted curves are included when fitting results are present. Parameters ---------- save_html : bool If True, also saves an interactive HTML file. Returns ------- str Me…

ParameterTypeDescription
save_htmlboolean

plot_steady_state_residuals

Save an XY plot of the steady-state fitting residuals. The residuals (observed minus fitted signal) are plotted against the ligand concentration on a logarithmic axis, with one panel per sample and a horizontal line at zero. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_steady_state_residuals` with the shared XY configurations. Requires ``run_steady_state_fitting``; samples without a steady-state fit are left out. Parameters ---------- save_html : bool If True, also saves an interactive HTML file. Returns -------…

ParameterTypeDescription
save_htmlboolean

plot_kinetics_residuals

Save an XY plot of the kinetics (association/dissociation) fitting residuals. The residuals (observed minus fitted signal) are plotted over time, colored by ligand concentration, with a horizontal line at zero. Panels and colors match ``plot_kinetic_traces``. The plot is produced by :func:`pykingenie.utils.plotting_xy.plot_association_dissociation_residuals` with the shared XY configurations. Requires ``run_kinetics_fitting``; traces without a fitted curve are left out. Setting ``smooth_curves`` with ``update_xy_trace_config`` median-smooths the residuals.…

ParameterTypeDescription
save_htmlboolean

get_export_availability

Report which kinds of data ``get_export_data`` can return. This only inspects the existing fitting objects; it never runs a fit. Returns ------- dict ``datasets``, ``kinetic-curves`` and ``steady-state-curves`` flags.

get_export_data

Return fitting datasets or fitted curves as records, without fitting. Parameters ---------- kind : str ``'datasets'`` for the measured association and dissociation traces of each fitting dataset, ``'kinetic-curves'`` for the fitted kinetic curves, or ``'steady-state-curves'`` for the fitted steady-state curves. Returns ------- list of dict One record per point, labeled with ``Dataset`` and ``Smax_ID``. Trace records also have ``Trace``, ``ID`` and ``Time``. Values are not rounded; non-finite values are null.…

ParameterTypeDescription
kind *string