Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Pylake v0.10.1 #207

Merged
merged 5 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# Changelog

## v0.10.1 | t.b.d.
## v0.10.1 | 2021-10-27

#### New features

* Add support for axial force detection (i.e. force detection along the Z axis). The high-frequency data can be accessed with `f.force1z` and `f.force2z` while the downsampled low-frequency channels can be accessed with `f.downsampled_force1z` and `f.downsampled_force2z`. The calibrations can be accessed with `f.force1z.calibration` and `f.force2z.calibration`. The Z component is *not* factored in the calculation of the total force `f.downsampled_force1` and `f.downsampled_force2`.
* Added support for axial force detection (i.e. force detection along the Z axis). The high-frequency data can be accessed with `f.force1z` and `f.force2z` while the downsampled low-frequency channels can be accessed with `f.downsampled_force1z` and `f.downsampled_force2z`. The calibrations can be accessed with `f.force1z.calibration` and `f.force2z.calibration`. The Z component is *not* factored in the calculation of the total force `f.downsampled_force1` and `f.downsampled_force2`.
* Added `KymoLineGroup.fit_binding_times()` to allow for dwelltime analysis of bound states found using kymotracker. See [kymotracking](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/kymotracking.html) for more information.
* Allow using data acquired with a fast force sensor by passing `fast_sensor=True` when creating a `PassiveCalibrationModel`.
* Allow using hydrodynamically correct power spectrum when performing force calibration. See [force calibration](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/force_calibration.html) for more information.
* Added ability to crop `CorrelatedStacks`. See [Correlated stacks](https://lumicks-pylake.readthedocs.io/en/latest/tutorial/correlatedstacks.html#correlated-stacks) for more information.

#### Bug fixes

* Show an error message when user attempts to refine lines before tracking or loading them so the kymotracker widget does not become unresponsive.
* Force calibration models now throw an error when a bead diameter of less than `10^-2` microns is used (rather than produce `NaN` results).
* Fixed bug that prevented export of `CorrelatedStack` if the alignment matrices were missing from the metadata.
* Fixed bug where the exported metadata fields were erroneously exported as `"Applied channel X alignment"` for `CorrelatedStack` where the alignment was not actually applied.
* Fixed error in optimal point determination for MSD estimator. Note that this bug led to an error being thrown when the number of points in the trace was exactly 4. Now it results in a more informative error message (`You need at least 5 time points to estimate the number of points to include in the fit.`).

#### Improvements

* Switch to trust region reflective algorithm for fitting thermal calibration spectrum. This results in fewer optimization failures.
* Make sure that `f_diode` stays below the Nyquist frequency during fitting.
* Switched to trust region reflective algorithm for fitting thermal calibration spectrum. This results in fewer optimization failures.
* Pylake now ensures that `f_diode` stays below the Nyquist frequency during fitting.
* Implemented a bias correction for the thermal calibration. Note that this typically leads to a small correction unless you use a very low number of points per block.

#### Deprecations
Expand Down
4 changes: 1 addition & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Force calibration

calculate_power_spectrum
fit_power_spectrum
CalibrationSettings
PassiveCalibrationModel
force_calibration.power_spectrum.PowerSpectrum
force_calibration.power_spectrum_calibration.CalibrationResults
Expand Down Expand Up @@ -85,8 +84,7 @@ Notebook widgets
:toctree: _api

FdRangeSelector
nb_widgets.fd_selector.SliceRangeSelector
nb_widgets.fd_selector.FdRangeSelectorWidget
FdDistanceRangeSelector

Population Dynamics
-------------------
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ scipy
sphinx
sphinx_rtd_theme
sphinxcontrib-bibtex==0.4.2
docutils<0.18
10 changes: 5 additions & 5 deletions docs/tutorial/kymotracking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ If we zoom in a bit, we can see that our traces in this image are about 0.3 micr
.. image:: kymo_zoom.png

The peaks have an intensity of about 3-7 photon counts, whereas the background fluctuates around 0-2. Let's set our
`pixel_threshold` to 4. We also see that sometimes, a particle momentarily disappears. To still connect these in a
single trace, we want to allow for some gaps in the connection step. Let's use a `window` size of 9 in this test.
`pixel_threshold` to 3. We also see that sometimes, a particle momentarily disappears. To still connect these in a
single trace, we want to allow for some gaps in the connection step. Let's use a `window` size of 6 in this test.
Considering that we only want to run the kymotracker on part of the image, we also pass the rect argument, which defines a rectangle over which to track peaks.
In this case, we track particles between 0 and 350 seconds, and 7 and 22 micron.
Running the algorithm is easy using the function :func:`~lumicks.pylake.track_greedy`::
Expand Down Expand Up @@ -337,9 +337,9 @@ With pure diffusive motion (a complete absence of drift) in an isotropic medium,

.. math::

\rho[n] = 2 D t + offset
\rho[n] = 2 D n \Delta t + offset

where :math:`D` is the diffusion constant in :math:`um^2/s`, :math:`t` is time, and the offset is determined by the localization accuracy:
where :math:`D` is the diffusion constant in :math:`um^2/s`, :math:`\Delta t` is the time step, :math:`n` is the step index and the offset is determined by the localization accuracy:

.. math::

Expand Down Expand Up @@ -479,7 +479,7 @@ Here, a random dataset with the same size as the original is sampled (with repla
is then fit using the MLE method, just as for the original dataset. The fit results in a new estimate for the model parameters.
This process is repeated many times, and the distribution of the resulting parameters can be analyzed to estimate certain statistics about the them::

dwell_2.run_bootstrap(iterations=1000)
dwell_2.calculate_bootstrap(iterations=1000)
dwell_2.bootstrap.plot(alpha=0.05)

.. image:: kymo_bind_bootstrap_2.png
Expand Down
5 changes: 2 additions & 3 deletions docs/tutorial/nbwidgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ regions using a widget. Let's load the file and run the widget::

You can use the left mouse button to select time ranges (by clicking the left and then the right boundary of the region
you wish to select). The right mouse button can be used to remove previous selections. We can access the selected
timestamps of the ranges we selected by invoking
:attr:`~lumicks.pylake.nb_widgets.fd_selector.SliceRangeSelector.ranges`::
timestamps of the ranges we selected by invoking `selector.ranges`::

>>> selector.ranges
[array([1572279165841737600, 1572279191523516800], dtype=int64),
array([1572279201850211200, 1572279224153072000], dtype=int64)]

And the actual slices from :attr:`~lumicks.pylake.nb_widgets.fd_selector.SliceRangeSelector.slices`. If we want to
And the actual slices from `selector.slices`. If we want to
plot all of our selections in separate plots for instance, we can do the following::

for data_slice in selector.slices:
Expand Down
2 changes: 1 addition & 1 deletion lumicks/pylake/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "lumicks.pylake"
__version__ = "0.10.0"
__version__ = "0.10.1"
__summary__ = "Bluelake data analysis tools"
__url__ = "https://github.com/lumicks/pylake"

Expand Down