diff --git a/changelog.md b/changelog.md index 27002f991..96860c7d8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,13 +1,14 @@ # 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 @@ -15,11 +16,12 @@ * 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 diff --git a/docs/api.rst b/docs/api.rst index 639071a69..33a0a7254 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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 @@ -85,8 +84,7 @@ Notebook widgets :toctree: _api FdRangeSelector - nb_widgets.fd_selector.SliceRangeSelector - nb_widgets.fd_selector.FdRangeSelectorWidget + FdDistanceRangeSelector Population Dynamics ------------------- diff --git a/docs/requirements.txt b/docs/requirements.txt index 67cd07e0b..3da357cf0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -9,3 +9,4 @@ scipy sphinx sphinx_rtd_theme sphinxcontrib-bibtex==0.4.2 +docutils<0.18 diff --git a/docs/tutorial/kymotracking.rst b/docs/tutorial/kymotracking.rst index a33f050aa..f78711747 100644 --- a/docs/tutorial/kymotracking.rst +++ b/docs/tutorial/kymotracking.rst @@ -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`:: @@ -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:: @@ -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 diff --git a/docs/tutorial/nbwidgets.rst b/docs/tutorial/nbwidgets.rst index 7f9d0ed18..67ad35ec4 100644 --- a/docs/tutorial/nbwidgets.rst +++ b/docs/tutorial/nbwidgets.rst @@ -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: diff --git a/lumicks/pylake/__about__.py b/lumicks/pylake/__about__.py index 3f22b90fa..05bb9ed74 100644 --- a/lumicks/pylake/__about__.py +++ b/lumicks/pylake/__about__.py @@ -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"