A Python-based application for analyzing molecular binding interactions using various spectroscopic assays. This tool provides robust mathematical fitting algorithms based on forward modeling approaches that overcome limitations of traditional data transformation methods commonly used in supramolecular chemistry and biochemistry.
Unlike traditional binding analysis methods that rely on data transformation (Scatchard plots, Hill plots, double-reciprocal plots), this application employs direct forward modeling where theoretical binding curves are fitted directly to raw experimental data. This approach offers several key advantages:
- Preserves Error Structure: Maintains native measurement uncertainties without distortion from data transformation
- Physical Constraints: Parameters are bounded by thermodynamically reasonable values, ensuring physically meaningful results
- Handles Complex Systems: Naturally accommodates competitive binding and ligand depletion scenarios
- Robust Validation: Model assessment occurs in the original measurement space where experimental errors are best understood
This application enables analysis of experimental data from various spectroscopic assays:
- GDA (Guest Displacement Assay): Quantifies guest binding affinity by monitoring displacement of a preformed host-indicator complex - particularly valuable for spectroscopically silent hosts and guests, and superior for insoluble or weakly binding guests
- IDA (Indicator Displacement Assay): Determines binding constants using competitive displacement of indicator dyes - enables detection in complex biological matrices through ultra-high-affinity reporter pairs
- DBA (Direct Binding Assay): Direct measurement of host-guest or dye-host binding interactions available in both titration modes - monitors spectroscopic changes upon complex formation but limited in complex matrices due to competitive binding from naturally occurring interferents
- Dye Alone: Linear calibration fitting for indicator dyes - establishes baseline fluorescence properties and corrects for inner filter effects in competitive binding assays
The application features an intuitive Tkinter-based graphical user interface with advanced data visualization, comprehensive statistical analysis, and flexible result export capabilities.
- Multiple Assay Types: Support for GDA, IDA, DBA (both host-to-dye and dye-to-host titrations), and dye alone calibration
- Advanced Optimization: L-BFGS-B constrained optimization with multi-start global optimization for robust parameter estimation
- Ensemble-Based Uncertainty: Parameter uncertainties estimated through ensemble statistics from multiple optimization runs, capturing nonlinear uncertainty propagation
- Physical Constraints: Thermodynamically bounded parameters ensure meaningful binding constants and fluorescence coefficients
- Multi-Level Quality Assessment: RΒ²/RMSE filtering with adaptive thresholds and parameter ensemble validation
- Robust Parameter Estimation: Median-based statistics from optimization ensembles provide outlier-resistant results
- Comprehensive Error Analysis: Confidence intervals that account for both optimization uncertainty and experimental variability
- Model Validation: Goodness-of-fit metrics and residual analysis in the original measurement space
- Data Visualization: Publication-quality plots with unified styling and export options
- Result Merging: Statistical combination of multiple fitting results with outlier detection using median absolute deviation criteria
- Cross-Platform: Available for Windows, macOS, and Linux with automated build system
- Laboratory Integration: Direct processing of BMG plate reader files with standardized data workflows
- π§ Parallel Processing: Multi-threading support for simultaneous analysis of multiple datasets
- π§ Automated Testing: Comprehensive validation of mathematical algorithms and data processing
- π§ Jupyter Integration: Included notebooks for advanced analysis and method development
- Python 3.8 or higher
- Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
- RAM: 2GB minimum, 4GB recommended
- Storage: 500MB free space
Core Analysis Engine:
matplotlib>=3.5.0 # Publication-quality visualizations with customizable styling
numpy>=1.21.0 # Numerical array operations and mathematical computations
pandas>=1.3.0 # BMG Labtech plate reader file processing and structured data manipulation
scipy>=1.7.0 # L-BFGS-B optimization and statistical functions
Key Technology Choices:
- scipy.optimize: L-BFGS-B constrained optimization selected for superior handling of parameter bounds with active-set strategy
- Tkinter: Cross-platform GUI compatibility without external dependencies
- Cross-Platform Distribution: PyInstaller-based executable generation through GitHub Actions CI/CD
- BMG Labtech Plate Readers: Direct processing of plate reader Excel exports with automatic 96-well layout extraction for high-throughput analysis
Download the latest release for your operating system from the Releases page:
- Windows:
windows-executable.zip - macOS:
macos-executable.zip - Linux (Ubuntu):
linux-executable.zip
-
Clone the repository:
git clone https://github.com/your-username/fitting_app.git cd fitting_app -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
For developers wanting to contribute or modify the code:
git clone https://github.com/your-username/fitting_app.git
cd fitting_app
pip install -e .
pip install -r requirements.txt- Launch the application by using the pre-built executable or running
python main.py - Select your assay type from the main interface
- Load your data using the file browser (supports .txt files, see
./data) - Configure fitting parameters in the interface
- Run the fitting and analyze results
Currently, input data should be in tab-delimited format with the following structure:
var signal
0.0 1.000
1e-6 0.995
2e-6 0.987
...
Combine multiple independent fitting results and perform a final fit:
- Select "Merge Fits" for your assay type
- Load multiple result files
- Perform a final fit over combined fits
- Generate combined statistics and plots
fitting_app/
βββ main.py # Application entry point
βββ requirements.txt
βββ README.md # This file
βββ core/ # Core fitting algorithms
β βββ fitting/ # Assay-specific fitting modules
β β βββ gda.py
β β βββ ida.py
β β βββ dba_host_to_dye.py
β β βββ dba_dye_to_host.py
β β βββ dye_alone.py
β βββ base_fitting_app.py # Base fitting framework
β βββ fitting_utils.py # Utility functions
β βββ forward_model.py # Mathematical models
βββ gui/ # User interface modules
β βββ main_interface.py
β βββ interface_*_fitting.py
β βββ interface_*_merge_fits.py
βββ utils/ # General utilities
βββ assets/ # icons & logos
βββ tests/ # Unit tests
βββ examples/ # Example data and scripts
βββ notebooks/ # Jupyter analysis notebooks
βββ data/ # Sample datasets
βββ docs/
βββ build/
βββ FittingApp.spec # Build configuration
The application implements rigorous binding models based on mass action kinetics and equilibrium thermodynamics:
DBA measures direct binding interactions through spectroscopic signal changes upon complex formation.
Equilibrium:
Host + Dye β Host-Dye Complex
Ka = [Host-Dye] / ([Host][Dye])
Signal Equation:
I = Iβ + I_dye Γ [Dye] + I_complex Γ [Host-Dye]
Where Iβ is baseline fluorescence, and I_dye, I_complex are molar fluorescence coefficients.
These assays involve coupled equilibria where two species compete for the same binding site.
Equilibria:
Host + Dye β Host-Dye (Ka_dye)
Host + Guest β Host-Guest (Ka_guest)
The mathematical framework handles the coupled mass balance equations numerically, accounting for competitive displacement based on relative binding affinities.
- Forward Modeling: Direct fitting of binding equations to raw data, avoiding transformation artifacts
- Physical Constraints: Binding constants bounded by thermodynamically reasonable ranges (10Β² to 10ΒΉβ° Mβ»ΒΉ)
- Statistical Rigor: Multiple optimization runs provide robust uncertainty estimates for all parameters
- Python 3.8+
- PyInstaller
- All dependencies from requirements.txt
Build executable:
pyinstaller --clean -y --distpath ./dist --workpath ./build FittingApp.specDevelopment build:
python -m buildThe built executable will be available in the dist/ directory.
Current Validation Methods:
- Real-world Performance: Typical fitting quality metrics (RΒ² > 0.99) across diverse molecular systems
- Parameter Consistency: Multi-start optimization ensures reproducible binding constants within statistical uncertainty
- Physical Validation: All fitted parameters maintain thermodynamic validity and experimental constraints
Future Testing Framework:
- π§ Comprehensive unittest suite for core algorithms
- π§ Integration tests for data processing workflows
- π§ Performance benchmarking across dataset sizes
- π§ Cross-validation with literature binding constants
- Version Control: Git-based change tracking and collaboration with systematic commit practices
- Continuous Deployment: Automated multi-platform builds (Windows, macOS, Linux) through GitHub Actions CI/CD pipeline
- Mathematical Validation: Forward modeling algorithms validated against theoretical binding isotherms
Planned Quality Enhancements:
- π§ Cross-Platform Testing: Automated validation across operating systems ensures consistent performance
- π§ Continuous Integration: Enhanced cross-platform compatibility verification with automated regression testing
- π§ Code Standardization: Automated formatting (Black) and style checking (pylint) for maintainable codebase
We welcome contributions! Our contributing guideline:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure tests pass:
python -m pytest - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow PEP 8 style guidelines
- Add docstrings to all functions and classes following Numpy's docstring standard
- Include unit tests for new features
π§ Coming soon
π§ Coming soon
- Fitting Speed: Typical datasets (8 replicas X 11 measurement points) fit in <1 second
- Memory Usage: <100MB for standard datasets
- Scalability: Tested with datasets up to 10,000 points
π§ WIP
Fitting convergence issues:
- Check data quality and remove outliers
- Adjust initial parameter estimates
- Verify data format matches expected structure
- Issues: Report bugs via GitHub Issues
- Discussions: Join conversations in GitHub Discussions
- Documentation Page: π§ Coming soon
This project is licensed under the GPL 3.0 License - see the LICENSE file for details.
π§ WIP
-
Sinn, S., Spuling, E., BrΓ€se, S., & Biedermann, F. (2019). Rational design and implementation of a cucurbit[8]uril-based indicator-displacement assay for application in blood serum. Chemical Science, 10(28), 6584-6593. https://doi.org/10.1039/C9SC00705A
-
Sinn, S., KrΓ€mer, J., & Biedermann, F. (2020). Teaching old indicators even more tricks: binding affinity measurements with the guest-displacement assay (GDA). Chemical Communications, 56(49), 6620-6623. https://doi.org/10.1039/D0CC01841D
Last Updated: August 2025
Contact: contact@suprabank.org