CLI¶
The cli module implements a command line interface that allows to interact with Curveball
through a command line or terminal, without any knowledge in Python programming.
The Tutorial includes a complete walkthrough on using the CLI to analyse growth cruves data.
Fit-and-compete¶
Use curveball fit_compete to estimate competition coefficients from mixed-culture data (requires a plate template that includes a total strain):
>>> curveball fit_compete mixed.xlsx --analyse_file=summary.csv --ref_strain=G --total=RG
This command reads the per-strain fits generated by curveball analyse but does not rerun individual competitions; instead it combines the reference and competitor parameter estimates, fits the predicted mixed OD curve to the observed total trace, and adjusts the competition coefficients to minimize the mean squared error.
The output CSV contains:
a1,a2: competition coefficients fromcurveball.competitions.fit_and_compete()MSE: mean squared error of the mixed-culture fit
Because fit_compete never reconstructs the separate time series for the assay and reference strains, it cannot derive the LTEE-style relative fitness (w). That value is only available through curveball analyse, which fits each strain individually, runs curveball.competitions.compete(), and evaluates fitness_LTEE on the resulting time course.
Analyse output columns¶
The curveball analyse command outputs a CSV table with one row per strain. Key columns include:
folder,filename: input file location and base name.strain: strain label from the plate template.model: best-fit model name.RSS,RMSD,NRMSD,CV(RMSD): fit error metrics.bic,aic,weighted_bic,weighted_aic: model selection scores.y0,K,r,nu,q0,v: fitted growth parameters.has_lag,has_nu: model selection flags.max_growth_rate,min_doubling_time,lag: derived metrics.w: relative fitness vs. reference strain.
If --ci is used, additional *_low/*_high columns are included for confidence intervals (e.g., lag_low, lag_high, K_low, K_high).
Members¶
- curveball.scripts.cli.find_plate_file(plate_folder, plate_file)[source]¶
Finds a plate file, either in the current working dir or in the package data resources.
Parameters¶
- plate_filestr
the filename of the plate file, may include absolute or relative path
Returns¶
- str
the full path of the plate file.
- curveball.scripts.cli.get_filename(filepath)[source]¶
Get a file name out of a file path.
Parameters¶
filepath : str
Returns¶
- str
filename