FCS-analysis / PyCorrFit

data analysis and fitting software for fluorescence correlation spectroscopy (FCS)
pycorrfit.craban.de
Other
48 stars 13 forks source link

Picoquant data file format #69

Closed paulmueller closed 9 years ago

paulmueller commented 10 years ago

Dear @dwaithe, you published a parser for the PicoQuant file format.

https://github.com/dwaithe/FCS_viewer

We could extend the readfiles module of PyCorrFit to support PicoQuant. What do you think?

Cheers, Paul

dwaithe commented 10 years ago

Dear Paul,

Sorry for my slow reply. I wanted to write something properly which often ends up not happening, if you know what I mean. It may not be clear from my github page but I am the Image Analyst at the Wolfson Imaging Centre, WIMM Oxford. My supervisor is an expert in FCS and FCS STED, Dr. Christian Eggeling. We are working on developing analysis tools which best facilitate the biophysicists in the group pursue their experiments. Some of the code I have been writing is on the github page as you saw. We were given the pt3 documentation from the PicoQuant people. I am responsible for converting the matlab script to python. Furthermore before you can fit the TCSPC data it needs to be correlated. TCSPC datasets are large and time consuming to correlate in normal way and so I implemented a python version of Enderlain’s methods for efficient correlation: http://www.opticsinfobase.org/oe/abstract.cfm?uri=oe-11-26-3583

We are happy to share these resources as we did not invent them but please credit me in if you use these resources.

Furthermore since the github version you saw, I have developed further resources for the correlation data which include curve fitting and batch processes. I have played with your implementation and took inspiration from it. I have tried to make something closer to Symphotime in terms of interface design but which has batch capabilities. I didn’t use your code for my implementation because I am using PyQT and it was easier to go from scratch but I will credit you in the code as an influence.

The next step for us is to introduce scanning FCS. I can see you also have an implementation of this. I will credit you if I end up using your correlation.

It is shame that we have some overlap in what we are doing…sorry for that, we just have an emphasis here for making tools which are as streamlined as possible for specifically the experiments we need to do. Still, l don’t think its a bad thing I really don’t mind if you draw inspiration from me and I hope vice versa. My goal is just to make tools which are really useful.

I have just updated the github. The newer version is in the v02 folder. The main file for pt3 correlation is FCSdataViewerMain.py. You can access the fitting my clicking the Fit Function tab.

Here is the binary reader for the .pt3 file:

The pt3 file import. pt3import(filepath): Outputs: chanArr (specifies which channel photon belongs to). The high channel ’15’ represents a new cycle of excitation and doesn’t represent a photon. Outputs: trueTimeArr (specifies the macroscopic time for the experiment e.g. arrival time globally). Outputs: dTimeArr (specifies the micro time for photon detections post excitation pulse).

Here is the fast-correlation algorithm function. I kept the notation just as in the matlab original to make testing easier:

The fast-correlation algorithm: tttr2xfcs(y,num,Ncasc, Nsub) requires: y which is the photon time macroscopic array. requires: num [:,2] array which is a binary association to each channel 0,1. requires: Ncasc and Nsub which define depth and extent of correlation across log scale. outputs: auto, correlation output [:,0,0] auto-correlation channel 0, [:,1,1] auto-correlation channel 1. [:,1,0] and [:,0,1] cross-correlation.

Thanks for your email, lets stay in touch. If you have any questions don’t hesitate. Best wishes, Dominic.

Dr. Dominic Waithe

Senior post-doctoral associate. Image analysis specialist. Wolfson Imaging Centre. Weatherall Institute of Molecular Medicine. University of Oxford, Oxford, OX3 9DS.

email: dominic.waithe@imm.ox.ac.ukmailto:dominic.waithe@imm.ox.ac.uk

http://www.imm.ox.ac.uk/wolfson-imaging-centre-oxford

On 9 Mar 2014, at 23:29, Paul Müller notifications@github.com<mailto:notifications@github.com> wrote:

Dear @dwaithehttps://github.com/dwaithe, you published a parser for the PicoQuant file format.

https://github.com/dwaithe/FCS_viewer

We could extend the readfiles module of PyCorrFit to support PicoQuant. What do you think?

Cheers, Paul

— Reply to this email directly or view it on GitHubhttps://github.com/paulmueller/PyCorrFit/issues/69.

naxir121 commented 10 years ago

Hi Paul, are you going to extend PyCorrFit to read the pt3 files? Erdinc.

paulmueller commented 10 years ago

Dear Dominic, thanks for your reply and for uploading a new version of FCS_viewer! I had a look at the code and I can see what you mean with "streamlined". You are using scipy's weave which requires a c compiler at runtime.

I think I can use your script with PyCorrFit. However, I might get into trouble with weave when I want to distribute binaries using PyInstaller.

So (@naxir121) don't expect pt3 file support in the near future (at least (1) not without the effort to install additional software like MinGW or (2) a very slow implementation).

Best, Paul

dwaithe commented 10 years ago

Dear Paul, Yeah I quite understand your point about compiling. My solution at the moment is to guide users to install python XY and then lmfit. Both have binary distributions for windows. I’ve experimented with compiling executables in the past for other projects and invariably its resulted in a nightmare.

The code: i1= np.in1d(y,[y+lag],assume_unique=True) i2= np.in1d([y+lag],y,assume_unique=True) represents the numpy alternative to: i1,i2 = divideAndConquerIntersect1D_CPP(y, y+lag,y.shape[0]) It was slower, but not terminal.

Cheers, Dominic.

On 24 Mar 2014, at 10:25, Paul Müller notifications@github.com wrote:

Dear Dominic, thanks for your reply and for uploading a new version of FCS_viewer! I had a look at the code and I can see what you mean with "streamlined". You are using scipy's weave which requires a c compiler at runtime.

I think I can use your script with PyCorrFit. However, I might get into trouble with weave when I want to distribute binaries using PyInstaller.

So (@naxir121) don't expect pt3 file support in the near future (at least (1) not without the effort to install additional software like MinGW or (2) a very slow implementation).

Best, Paul

— Reply to this email directly or view it on GitHub.

paulmueller commented 10 years ago

There now is a tentative version of PyCorrFit that supports the .pt3 file format.

https://github.com/paulmueller/PyCorrFit/releases

Feedback is very much welcome! Thanks again to Dominic for the Cython implementation.

Cheers, Paul