Giter Club home page Giter Club logo

fluorescence-tools / chisurf Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 1.0 198.05 MB

Global analysis platform for fluorescence data

Home Page: https://www.peulen.xyz/software/chisurf/

License: GNU General Public License v2.0

Python 95.42% C++ 0.35% Batchfile 0.02% Inno Setup 0.04% Shell 0.96% AGS Script 2.05% CSS 0.24% Ruby 0.01% AppleScript 0.03% Cython 0.80% C 0.08%
fluorescence fluorescence-data global-analysis spectroscopy fluorescence-decays-analysis correlation protein multiple-datasets

chisurf's Introduction

conda build Anaconda-Server Version DOI

ChiSurf

ChiSurf is a software package for the analysis of complex fluorescence data acquired in time-resolved single-molecule and ensemble fluorescence experiments. The main feature of ChiSurf is the joint (global) analysis of multiple datasets. ChiSurf GUI

History

The original of ChiSurfs was to estimate errors of model parameters of fluorescence intensity decays in Förster-resonance energy transfer (FRET) experiments for FRET-driven structural models of protein and other biological macromolecules. It started as a collection of python scripts. With time more features were added, e.g., the analysis of correlation curves, correlation of time-tagged-time resolved (TTTR) data. A graphical user interface makes these scripts and tools available for users without programming experience. Overall, ChiSurf is highly experimental and its core is still heavily refactored. Consequently, features, which worked in old versions, may be not supported in newer versions, unless users explicitly demand these functions.

Features

General features

  • Scripting interface and open API
  • Interactive analysis of multiple datasets
  • Combined analysis of different experimental techniques

Global analysis

  • Analysis of multiple data sets by joint model function freely defined by the user
  • Freely definable models for FCS analysis & adaptable models for fluorescence decays analysis
  • Fluorescence decay analysis
  • Global analysis of multiple fluorescence decays
  • Generation of fluorescence decay histograms based on TTTR data
  • Analysis of time-resolved anisotropy decays
  • Analysis of FRET quenched fluorescence decays by physical model functions

DOI for citing FPS

Fluorescence correlation spectroscopy

  • Analysis of FCS curves
  • Correlation of TTTR-data by efficient correlation algorithms DOI for citing FPS

Simulation of fluorescence observables

  • Kappa2 distributions based on residual anisotropies
  • Simulation of fluorescence quenching in protein by aromatic amino acids
  • Simulation of FRET rate constant distributions based on accessible volumes

Download

ChiSurf is available as a compiled Windows installation file. By downloading and using ChiSurf, you agree with the following terms:

ChiSurf is provided “as is” without warranty of any kind, express or implied. The authors of ChiSurf shall not be, in any event, be held liable for any claim, damages or other liability arising from the use of ChiSurf. As the user, you are not allowed to redistribute any or all of the code, in any manner to other parties. The downloaded code is for your use only. ChiSurf is provided free of charge to both academic and commercial users.

Conda

Either clone the repository and install dependencies using the provided environemnt.yml file. Or install chisurf using conda/mamba:

conda create -n chisurf
conda activate chisurf
mamba install chisurf -c tpeulen

To start using the software activate the chisurf environment and start the ChiSurf GUI:

conda activate chisurf
chisurf

Windows & macOS

All past and current release can be downloaded from https://www.peulen.xyz/downloads/

Linux

Linux users with snap scan simply install ChiSurf using snap.

Get it from the Snap Store

Support

Please submit feature requests, questions, and bugs as GitHub issues. General questions are addressed and discussed in the Discord group

References

  1. Peulen T, Opanasyuk O, Seidel C. Combining Graphical and Analytical Methods with Molecular Simulations To Analyze Time-Resolved FRET Measurements of Labeled Macromolecules Accurately. J Phys Chem B. 2017;121(35):8211-8241.

  2. Wahl M, Gregor I, Patting M, Enderlein J. Fast calculation of fluorescence correlation data with asynchronous time-correlated single-photon counting. Opt Express. 2003;11(26):3583-3591.

  3. Sindbert S, Kalinin S, Nguyen H, et al. Accurate distance determination of nucleic acids via Förster resonance energy transfer: implications of dye linker length and rigidity. J Am Chem Soc. 2011;133(8):2463-2480.

  4. Kalinin S, Peulen T, Sindbert S, et al. A toolkit and benchmark study for FRET-restrained high-precision structural modeling. Nat Methods. 2012;9(12):1218-1225.

chisurf's People

Contributors

tpeulen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

uscbiophyschem

chisurf's Issues

Snap does not work on Ubuntu 18.04 LTS

On Noahs Laptop chisurf does not start when using the snap distribution. There is an error (likely missing libary) with the snap package.

See error message below

'''
Traceback (most recent call last):
File "mfm_gui.py", line 27, in
import mfm
File "/snap/chisurf/7/mfm/init.py", line 226, in
from . import fitting
File "/snap/chisurf/7/mfm/fitting/init.py", line 3, in
import models
File "/snap/chisurf/7/mfm/fitting/models/init.py", line 16, in
from mfm import plots
File "/snap/chisurf/7/mfm/plots/init.py", line 4, in
from .MolView import *
File "/snap/chisurf/7/mfm/plots/MolView.py", line 6, in
from OpenGL.GL import *
File "/snap/chisurf/7/python/lib/python2.7/site-packages/OpenGL/GL/init.py", line 4, in
from OpenGL.GL.VERSION.GL_1_1 import *
File "/snap/chisurf/7/python/lib/python2.7/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in
from OpenGL.raw.GL.VERSION.GL_1_1 import *
File "/snap/chisurf/7/python/lib/python2.7/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in
from OpenGL.raw.GL import _errors
File "/snap/chisurf/7/python/lib/python2.7/site-packages/OpenGL/raw/GL/_errors.py", line 4, in
_error_checker = _ErrorChecker( _p, _p.GL.glGetError )
AttributeError: 'NoneType' object has no attribute 'glGetError'
'''

FRET: FD Fit does not work (v17.03.24)

Describe the bug
Selecting FRET:FD Fit does not open a Fit window

To Reproduce
Steps to reproduce the behavior:

  1. Load a dataset into ChiSurf
  2. Select model: 'FRET: FD (Discrete)
  3. Press add fit
  4. Nothing happens

Expected behavior
A fit window appears, enabling D0 calibrated lifetime fits

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [win10 x64
  • Version 17.03.24

Additional context
Using the Record Movie feature, this command was executed:

cs.add_fit(model_name='FRET: FD (Discrete)', dataset_idx=[1])

support range for lifetime fractions does not work

Describe the bug
Upon using parameter scan for lifetime fractions (xl1, xl2, ..), the fit does not execute the scan but reports nonsense values.

Edit: the issue appears for lifetime fits and gauss fits.

Screenshots
lifetime fit:
csParameterScanFailsForLifetimeFractions
Gauss fit:
image

Desktop (please complete the following information):
windows, cs 17.03.24

More convinient anisotropy analysis of vv and vh decays

I have experienced that when one fits vv and vh decays with purpose of getting depolarization times and their amplitudes, one can get very good fit of vv and vh decays, but when these model vv and vh decays are combined into anisotropy, it does not necessarily fit into raw anisotropy decay.
After first fit iteration, user has to export model decays, combine them into anisotropy, and see how it fits into actual anisotropy decay. I experienced that often it misfits in the maximum (where r0 and g-factor contribute the most). Then, additional interation is needed to try to improve the fit. Again-export model decays, combine them, check how it fits.
It would be great if there would be a feature that combines vv and vh model decays, and overlays it with raw anisotropy, as additional fit quality check.

Export of data

When exporting the data, writing frequency is not uniform: often it happens that initially writes data with dt step, and then few points with 2*dt step, and then goes back to dt writing frequency, and so on. This happens randomly in the data array, and is difficulty for post-processing of the saved data- such as combining VV and VH models into anisotropy etc.

Running chisurf on MacOS

Hi Thomas,

the latest Mac release of ChiSurf is quite old, and I would like to use the newest version natively on Mac.

Here is what I did:

  1. Clone the repository.
  2. Make a new conda environment from the environment.yml file.
  3. Activate this environment.
  4. Run python setup.py install
  5. Run chisurf from terminal.

Here is the error I get.

(chisurf) Anders@Anders-MBP chisurf % chisurf
Traceback (most recent call last):
  File "/Users/Anders/opt/anaconda3/envs/chisurf/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2458, in resolve
    return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'chisurf.gui' has no attribute 'gui'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Anders/opt/anaconda3/envs/chisurf/bin/chisurf", line 11, in <module>
    load_entry_point('chisurf==19.9.22', 'gui_scripts', 'chisurf')()
  File "/Users/Anders/opt/anaconda3/envs/chisurf/lib/python3.7/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/Anders/opt/anaconda3/envs/chisurf/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2859, in load_entry_point
    return ep.load()
  File "/Users/Anders/opt/anaconda3/envs/chisurf/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/Users/Anders/opt/anaconda3/envs/chisurf/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2460, in resolve
    raise ImportError(str(exc))
ImportError: module 'chisurf.gui' has no attribute 'gui'

Not sure what is going wrong. I also tried running chisurf from code (base.py), but I get import errors.

What did I do wrong?

BIFL scatter fit - incorrect scatter estimation?

Hi Thomas,

when specifying a background curve and using the automatic estimation of background and fluorescence photons from the measurement durations, we noticed that we could not get a correct fit. To understand how things are implemented, I looked into the code and noticed that the model decay, before being multiplied by the estimated photon number, is not normalized to an area of 1.
Here are the respective lines in models/tcspc/lifetime.py

        # Calculate background curve from reference measurement
        if isinstance(
                background_curve,
                chisurf.curve.Curve
        ):
            if shift_bg_with_irf:
                background_curve = background_curve << self.convolve.timeshift

            bg_y = np.copy(background_curve.y)
            bg_y /= bg_y.sum()
            bg_y *= self.generic.n_ph_bg

            decay *= self.generic.n_ph_fl
            decay += bg_y

It turns out that the sum of the decay is > 1.

Is this intended behavior? Otherwise, I would suggest to normalize the decay to its sum before multiplying with the photon number, as done for the background pattern.

white text on white background in terminal

Is your feature request related to a problem? Please describe.
Mykola mentioned that you can also script ChiSurf, which is a really powerfull feature.
The commands can be deduced from the input in the terminal window. However the text on the terminal window is white on a white background. i.e. not readable unless selected.

Describe the solution you'd like
Make either the text or the background black,.

Describe alternatives you've considered

Additional context

terminal-command for saving fit

Is your feature request related to a problem? Please describe.
I would like to save-fits from the command line or from a script

Describe the solution you'd like
To know the command which is run when the button File>Save Fit Results>Save Current Fit is pressed

Describe alternatives you've considered
I've tried the command:
cs.current_fit.save(path, name)
But it seems that is must be embedded to create a dir etc.

Additional context
I've visited the google groups page as was suggested on the github welcome page, but I was denied access.

Error function for FCS with non-Gaussian MDF

Is your feature request related to a problem? Please describe.
We are currently trying to analyze some TIR-FCS data, and tried to use ChiSurf for that. The problem: For that (and other non-Gaussian MDFs, like Lorentzian) we need the error function erf(x), which is not supported right now.

We already received a partial solution with a new parse.py for the 2017 release which supports the "classical" error function erf(x), which kind of worked. Two problems remain (see attachments), which I assume are connected:

  1. The fit does not converge (when I press "Fit", I get NaN in all free parameters).
  2. Towards long lag times, the model returns nonsense. I am not 100 % sure why, but my experience using erf(x) and modifications thereof (erfc(x), erfcx(x)) in Origin suggests that it's due to the extreme values returned by the error function, causing overflow/underflow. That's why I would also like a dedicated solver for the scaled complementary error function erfcx(x)=exp(x^2)*(1-erf(x)), which will circumvent the problem if I'm right about my assumption. At least when testing in Origin, it did.

Describe the solution you'd like
Introduction of error function erf(x), complementary error function erfc(x), and scaled complementary error function erfcx(x) into ChiSurf models, and perhaps addition of simple TIR-FCS models (see Hassler et al. BiophysJ 2005 and Hassler et al. Opt Expr 2005) as default models in future release. I can also contribute the latter, once the former is taken care of.

Describe alternatives you've considered

Additional context
Screenshot of model in ChiSurf (parameters manually set, not fitted):
Capture

JSON file with model as used in screenshot (sorry in advance if there is a comma error again):
3D_TIR-Gauss_Model_json.txt

start chisurf instance from python script

Is your feature request related to a problem? Please describe.
For the CD95 project we are doing many TCSPC fits, similar to the TGR5 project. The option to run scripts in Chisurf is already quite helpful. Is it also possible to create a Chisurf instance from a python interpreter and do fitting there? In this way chisurf TCSPC fitting can be embedded in whatever analysis other analysis is undertaken.
We do live-cell data, so we generate a lot of data for which I'd like to automate the analysis.

Describe the solution you'd like

  • which dir must be added to $PYTHONPATH
  • how to import the chisurf package
  • how to initialize a Chisurf instance
    From there the combination command line + cs gui should enable scripting Donor only calibrated Donor Acceptor fits.

Describe alternatives you've considered
I have a few scripts for running batch fits in Chisurf. It works ok, but it's a bit messy and I'd like to automate human clicking as far as routine analysis is concerned. If it works nicely, it can be modularly implemented wherever TCSPC fitting is needed.

Additional context
Chisurf running py2.7 and Jupyter QtConsole 4.2.1 (I couldn't find the software version).
Is pain to be expected from running py2.7 chisurf in 3.7 interpreter?

Many thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.