Skip to main content

Cli for fitting macromolecule pH titration or binding assays data e.g. fluorescence spectra.

Project description

Tests PyPI RtD

ClopHfit

  • Cli for fitting macromolecule pH titration or binding assays data e.g. fluorescence spectra.

  • Version: “0.3.0a2”

Installation

At this stage few scripts are available in src/clophfit/old.

pyenv install 3.6.15
poetry install
poetry run pytest -v

Use

fit_titration.py

A single script for pK and Cl and various methods w/out bootstraping: 1. svd 2. bands and 3. single lambda.

input ← csvtable and note_file

output → pK spK (stdout) and pdf of analysis

To do
  • Bootstrap svd with optimize or lmfit.

  • Average spectra

  • Join spectra [‘B’, ‘E’, ‘F’]

  • Compute band integral (or sums)

fit_titration_global.py

A script for fitting tuples (y1, y2) of values for each concentration (x). It uses lmfit confint and bootstrap.

input ← x y1 y2 (file)

output → K SA1 SB1 SA2 SB2 , png and correl.png

In global fit the best approach was using lmfit without bootstraping.

Example
for i in *.dat; do gfit $i png2 --boot 99 > png2/$i.txt; done

Old tecan todo list

I do not know how to unittest

  • better fit 400, 485 (also separated) e bootstrap to estimate uncertanty

  • print sorted output

  • buffer correction and report controls e.g. S202N, E2 and V224Q

  • dilution correction

  • check metadata and report the diff REMEMBER 8.8; dataframe groupby per meta_pre, ma anche enspire

  • fit chloride

  • fluorescence is constant? GREAT

  • plot data when fit fail and save txt file

Development

Make sure this README passes https://pypi.org/project/readme-renderer/

gh release create (--target devel) v0.3.0a0

gh workflow disable|enable|view|run|list

TL;DR

poetry env use 3.9
poetry install
pre-commit install
pre-commit install --hook-type commit-msg

When needed (e.g. API updates):

sphinx-apidoc -f -o docs/api/ src/clophfit/

For Jupyter:

poetry run python -m ipykernel install --user --name="clophfit"

Development environment

  • Test automation requires nox and nox-poetry.

  • Formatting with black[jupyter] configured in pyproject.

  • Linters are configured in .flake8 .darglint and .isort.cfg and include:

    - flake8-isort
    - flake8-bugbear
    - flake8-docstrings
    - darglint
    - flake8-eradicate
    - flake8-comprehensions
    - flake8-pytest-style
    - flake8-annotations (see mypy)
  • pre-commit configured in .pre-commit-config.yaml activated with:

    - pre-commit install
    - commitizen install --hook-type commit-msg
  • Tests coverage (pytest-cov) configured in .coveragerc.

  • Type annotation configured in mypy.ini.

  • Commitizen also used to bump version:

    cz bump --changelog-to-stdout --files-only --prerelease alpha --increment MINOR
    • need one-time initialization:

      (cz init)
  • xdoctest

  • sphinx with pydata-sphinx-theme and sphinx-autodoc-typehints. (nbsphinx, sphinxcontrib-plantuml):

    mkdir docs; cd docs
    sphinx-quickstart

    Edit conf.py [“sphinx.ext.autodoc”] and index.rst [e.g. api/modules]:

    sphinx-apidoc -f -o docs/api/ src/clophfit/
  • CI/CD to PYPI configured in .github/:

    tests.yml
    release.yml

What is missing to modernize:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ClopHfit-0.3.0a2.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

ClopHfit-0.3.0a2-py3-none-any.whl (20.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page