Skip to content

Commit 99c6142

Browse files
author
Paul Müller
committed
Merge pull request #138 from paulmueller/develop
Develop
2 parents da4e464 + 44723f5 commit 99c6142

31 files changed

+1187
-516
lines changed

ChangeLog.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
0.9.3
2+
- Fitting: migrate to lmfit
3+
- This introduces a new dependency for building PyCorrFit.
4+
(e.g. in Debian, the package "python-lmfit" is required)
5+
- Improved fitting behavior at parameter boundaries
6+
- Removed "Polak-Ribiere" fitting algorithm
7+
- Added "Sequential Linear Squares Programming" algorithm
8+
- Heuristic fit (#109):
9+
- Detect parameters that are stuck during fitting
10+
- Fit each curve five times or less and check
11+
whether the fit converges.
12+
- If two diffusion time parameter exist in a model, always
13+
make sure that one parameter is the larger one. This
14+
feature can currently not be disabled (#110).
15+
- Allow infinity ("inf" and "-inf") parameters for models
16+
and boundaries.
17+
- New model: confocal T+T+3D+3D
18+
- Bugfixes:
19+
- Sessions saved with 64bit Windows were not opened (#136)
20+
- Old sessions and "KeyError: 'chi2'"
21+
- Old session file extension was not recognized (#106)
122
0.9.2
223
- Bugfixes:
324
- "Slider Simulation"/"Parm Range" broken (#133)

appveyor.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,15 @@ install:
6565
# CONDA installs
6666
# Pinned versions are defined in freeze_appveyor\pinned
6767
- xcopy freeze_appveyor\pinned %PYTHON%\conda-meta\ /Y
68-
- "conda install --yes numpy"
69-
- "conda install --yes pip"
70-
- "conda install --yes scipy"
71-
- "conda install --yes wxpython"
68+
- "conda install --yes --quiet numpy pip scipy wxpython"
7269
# PIP installs
7370
# Install the build dependencies of the project.
7471
- "pip install cython"
7572
- "pip install wheel"
7673
# Install package-specific libraries
7774
- "pip install matplotlib"
7875
- "pip install sympy"
76+
- "pip install lmfit"
7977
# Install pyinstaller
8078
- 'ECHO Downloading %PYWIN_DL%'
8179
- ps: (new-object net.webclient).DownloadFile("$env:PYWIN_DL", 'C:/pywin_inst.exe')
@@ -103,11 +101,11 @@ after_test:
103101
- ps: "ls dist"
104102
# Run pyinstaller
105103
# This will create the "win7_innosetup.iss" file
106-
- "%WITH_COMPILER% pyinstaller -y freeze_pyinstaller\\PyCorrFit_win7.spec"
104+
- "%WITH_COMPILER% pyinstaller -y --log-level=WARN freeze_pyinstaller\\PyCorrFit_win7.spec"
107105
# Create InnoSetup installers
108106
# Set InnoSetup path here, because Cython complained about it.
109107
- set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5"
110-
- iscc win7_innosetup.iss
108+
- iscc /VERYSILENT win7_innosetup.iss
111109

112110
artifacts:
113111
# Archive the generated wheel package in the ci.appveyor.com build report.

doc/PyCorrFit_doc_content.tex

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,7 @@ \subsubsection{Software}
5757
\item\textbf{PyPI.} To run \textit{PyCorrFit} on any other operating system, the installation of Python v.2.7 is required. \textit{PyCorrFit} is included in the Python package index (PyPI, \url{http://pypi.python.org/pypi/pip}) and can be installed via\footnote{See also the wiki article at \url{https://github.com/paulmueller/PyCorrFit/wiki/Installation_pip}}
5858
\texttt{pip~install~pycorrfit$\!$[GUI]}.
5959
\item \textbf{Sources.}
60-
You can also directly download the source code at any developmental stage\footnote{See also the wiki article at \url{https://github.com/paulmueller/PyCorrFit/wiki/Running-from-source}}. \textit{PyCorrFit} depends on the following python modules:
61-
\texttt{
62-
\begin{itemize}
63-
\item matplotlib ($\geq$ 1.0.1)
64-
\item NumPy ($\geq$ 1.5.1)
65-
\item PyYAML
66-
\item SciPy ($\geq$ 0.8.0)
67-
\item sympy ($\geq$ 0.7.2)
68-
\item wxPython3
69-
\end{itemize}
70-
}
60+
You can also directly download the source code at any developmental stage\footnote{See also the wiki article at \url{https://github.com/paulmueller/PyCorrFit/wiki/Running-from-source}}.
7161
\end{itemize}
7262

7363

@@ -80,7 +70,7 @@ \subsection{Workflow}
8070

8171
The following chapter introduces the general idea of how to start and accomplish a fitting project. FCS experiments produce different sets of experimental correlation functions which must be interpreted with appropriate physical models (\hyref{Chapter}{sec:theor}). Each correlation function refers to a single contiguous signal trace or ``run''. In \textit{PyCorrFit}, the user must assign a mathematical model function to each correlation function during the loading procedure. The assignment is irreversible in the sense that within an existing \textit{PyCorrFit} session it cannot be changed. This feature assures the stability of the batch processing routine for automated fitting of large data sets. Nevertheless, the fit of different models to the same data can be explored by loading the data twice or simply by creating two different sessions.
8272

83-
Let's briefly discuss a typical example: To determine the diffusion coefficient of a fluorescently labeled protein in free solution, one has to deal with two sets of autocorrelation data: measurements of a diffusion standard (e.g. free dye for which a diffusion coefficient has been published) to calibrate the detection volume and measurements of the protein sample. The protein sample may contain small amounts of slowly diffusing aggregates. While the calibration measurements can be fitted with a one-component diffusion model (T-3D), the protein sample displays two mobility states, monomers and aggregates, which are taken into account by a two-component diffusion model (T-3D-3D). With \textit{PyCorrFit} such a situation can be treated in three ways, having different pros and cons:
73+
Let's briefly discuss a typical example: To determine the diffusion coefficient of a fluorescently labeled protein in free solution, one has to deal with two sets of autocorrelation data: measurements of a diffusion standard (e.g. free dye for which a diffusion coefficient has been published) to calibrate the detection volume and measurements of the protein sample. The protein sample may contain small amounts of slowly diffusing aggregates. While the calibration measurements can be fitted with a one-component diffusion model (T+3D), the protein sample displays two mobility states, monomers and aggregates, which are taken into account by a two-component diffusion model (T+3D+3D). With \textit{PyCorrFit} such a situation can be treated in three ways, having different pros and cons:
8474

8575

8676
\begin{enumerate}
@@ -306,9 +296,9 @@ \subsection{Models}
306296
\rule{0pt}{3ex} - Confocal (Gaussian): T+3D+3D & Triplet with two diffusive components \\
307297
%Confocal (Gaussian): T+3D+3D+3D & [Triplet with three diffusive components]
308298
%Confocal (Gaussian): 2D & 2D diffusion, e.g. in membranes \\
309-
\rule{0pt}{3ex} - Confocal (Gaussian): T-2D & Triplet blinking and 2D diffusion \\
310-
\rule{0pt}{3ex} - Confocal (Gaussian): T-2D-2D & Triplet with two diffusive components \\
311-
\rule{0pt}{3ex} - Confocal (Gaussian): T-3D-2D & Triplet with mixed 3D and 2D diffusion \\
299+
\rule{0pt}{3ex} - Confocal (Gaussian): T+2D & Triplet blinking and 2D diffusion \\
300+
\rule{0pt}{3ex} - Confocal (Gaussian): T+2D+2D & Triplet with two diffusive components \\
301+
\rule{0pt}{3ex} - Confocal (Gaussian): T+3D+2D & Triplet with mixed 3D and 2D diffusion \\
312302
\rule{0pt}{3ex}
313303
\end{tabular}
314304

@@ -734,9 +724,8 @@ \subsubsection{Algorithms}
734724
\item The \textbf{BFGS} method uses the quasi-Newton method of Broyden, Fletcher, Goldfarb, and Shanno (BFGS) \cite{Nocedal2006} (pp. 136). It uses the first derivatives only. BFGS has proven good performance even for non-smooth optimizations.
735725
\item The \textbf{Levenberg-Marquardt} algorithm \cite{Levenberg1944} uses the first derivatives and combines the Gauss–Newton algorithm with a trust region approach. It is very robust compared to other algorithms and it is very popular in curve-fitting. \textit{PyCorrFit} uses this algorithm by default. If this algorithm is used, \textit{PyCorrFit} can estimate an error of the fit parameters using the covariance matrix.
736726
\item The \textbf{Nelder-Mead} method uses the Simplex algorithm \cite{Nelder1965,Wright1996}. This algorithm has been successful in many applications but other algorithms using the first and/or second derivatives information might be preferred for their better performances and robustness in general.
737-
\item The method \textbf{Polak-Ribiere} uses a nonlinear conjugate gradient algorithm by Polak and Ribiere, a variant of the Fletcher-Reeves method described in \cite{Nocedal2006} pp.
738-
120-122. Only the first derivatives are used.
739727
\item The method \textbf{Powell} is a modification of Powell's method \cite{Powell1964, Press} which is a conjugate direction method. It performs sequential one-dimensional minimizations along each vector of the directions set, which is updated at each iteration of the main minimization loop. The function need not be differentiable, and no derivatives are taken.
728+
\item \textbf{Sequential Linear Squares Programming} inherently accepts boundaries and thus might behave better than other algorithms for problems with bounded parameters.
740729
\end{itemize}
741730

742731
\input{PyCorrFit_doc_models}

doc/PyCorrFit_doc_models.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ \subsection{Confocal FCS}
167167
\end{center}
168168
\vspace{2em}
169169

170+
171+
% 3D+3D diffusion + T+T
172+
\noindent \begin{tabular}{lp{.7\textwidth}}
173+
Name & \textbf{Confocal (Gaussian) T+T+3D+3D} \\
174+
ID & \textbf{6043} \\
175+
Descr. & Two-component three-dimensional free diffusion with a Gaussian laser profile, including two triplet components.
176+
The correlation function is a superposition of three-dimensional model functions of the type \textbf{T+3D} (6011).
177+
\end{tabular}
178+
\vspace{2em}
179+
180+
181+
170182
\subsection{TIR-FCS}
171183
\label{sec:imple.tirfc}
172184
The model functions make use of the Faddeeva function (complex error function)\footnote{In user-defined model functions (\hyref{Section}{sec:hacke.extmod}), the Faddeeva function is accessible through \texttt{wofz()}. For convenience, the function \texttt{wixi()} can be used which only takes $\xi$ as an argument and the imaginary $i$ can be omitted.}:

freeze_travis/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Cython==0.22
2+
lmfit
23
matplotlib==1.4.3
34
numpy==1.9.2
45
PyYAML==3.11

pycorrfit/doc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(self):
2626
with warnings.catch_warnings():
2727
warnings.simplefilter("ignore")
2828
matplotlib.use('WXAgg') # Tells matplotlib to use WxWidgets for dialogs
29+
import lmfit
2930
import numpy
3031
import os
3132
import platform
@@ -148,6 +149,7 @@ def SoftwareUsed():
148149
text = "Python "+sys.version+\
149150
"\n\nModules:"+\
150151
"\n - cython "+\
152+
"\n - lmfit "+lmfit.__version__+\
151153
"\n - matplotlib "+matplotlib.__version__+\
152154
"\n - NumPy "+numpy.__version__+\
153155
"\n - PyYAML "+yaml.__version__ +\

0 commit comments

Comments
 (0)