dwaithe / fcs_point_correlator Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
I am using some of the functionalities of focuspoint in PyCorrFit. Currently, I believe the version I am using is very outdated. To incorporate focuspoint funcitonalities in PyCorrFit (including new file formats), I usually have to update my wrapper which is time-consuming.
Would it be possible for you to create separate submodules (separate folders with __init__.py
file) for file reading, data correlation, and fitting algorithms (that do not contain any PyQt dependencies)?
I know this probably takes some time, but it would help me a lot.
Cheers,
Paul
Hi,
I think the current version cannot reflect the change of file name in the data series viewer. If we have a huge dataset comprising several comparison sets which are not in consecutive order or image on the same day, it is not possible to distinguish them after the fitting. I think it currently reflect the name in the .fcs file but not on the file name. Is it possible to revert this feature to an older version? Many thanks,
Isaac
See e.g. this file:
bhspcm_2019-04-03_12-07-51.zip
See also my pull request.
There is one more issue - for some reason there is a single count in channel 3 (may be an issue with the router, I did not collect the data myself) which leads to the x-correlation and correlation for channel 3 also being displayed. The normalization methods throw some Exceptions and the display stays empty, I did not debug through why.
Hi Dominic, I hope you can help.
I get the below error on opening a .ptu data set created with Abberior Imspector, using FoCuS_point_win_1_13_130.exe
Imspector version: 16.3.13036-w2049-win64
ptu file is here: https://drive.google.com/file/d/1_TvT3HHLDENOMv8qZp3TNP3Xmpl4BKjH/view?usp=sharing
it's a crappy test data set of circular scanning, but I can get the time trace, pch, and acf using SymPhoTime, so I assume the file isn't corrupted.
Please let me know if there's anything I can do to help. I'll download the repo and take a look under the hood in case there's anything that I'm able to help with.
Neil
Traceback (most recent call last):
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_gui", line 213, in showDialog
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_objects", line 60, in __init__
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_objects", line 78, in processData
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\import_methods", line 137, in ptuimport
AttributeError: 'int' object has no attribute 'astype'
In the latest release, the documentation file FoCuS-point-correlation-manual.pdf ends abruptly at page 6.
I would like to add *.ptu support of T2 mode.
I changed function from demo code and change like ReadHT3.
Is it possible to add this functional?
`
def readPT2(inputfile,numRecords,MeasDesc_GlobalResolution):
chanArr = [0]*TTResult_NumberOfRecords
trueTimeArr =[0]*TTResult_NumberOfRecords
dTimeArr= [0]*TTResult_NumberOfRecords
T2WRAPAROUND = 210698240
for recNum in range(0, numRecords):
try:
recordData = "{0:0{1}b}".format(struct.unpack("<I", inputfile.read(4))[0], 32)
except:
print("The file ended earlier than expected, at record %d/%d." \
% (recNum, numRecords))
exit(0)
channel = int(recordData[0:4], base=2)
time = int(recordData[4:32], base=2)
if channel == 0xF: # Special record
# lower 4 bits of time are marker bits
markers = int(recordData[28:32], base=2)
if markers == 0: # Not a marker, so overflow
gotOverflow(1)
oflcorrection += T2WRAPAROUND
else:
# Actually, the lower 4 bits for the time aren't valid because
# they belong to the marker. But the error caused by them is
# so small that we can just ignore it.
truetime = oflcorrection + time
gotMarker(truetime, markers)
else:
if channel > 4: # Should not occur
print("Illegal Channel: #%1d %1u" % (recNum, channel))
truetime = oflcorrection + time
trueTimeArr[cnt_ph] = truetime
dTimeArr[cnt_ph] = time
chanArr[cnt_ph] = channel+1
cnt_ph = cnt_ph +1
return np.array(chanArr[0:cnt_ph]), np.array(trueTimeArr[0:cnt_ph]), np.array(dTimeArr[0:cnt_ph]), MeasDesc_GlobalResolution* 1e6
`
I'm trying to upload .csv file in Focus_point_mac_1_16_208 in order to fit my FCS curves. My .csv file consists in two columns with G(tau) and tau as columns name. Whenever I load this file the software simply crashes.
Do you maybe have an idea why it's not working? Could you maybe help me ?
Thank you very much in advance,
Giovanni
These are the information of my system :
macOS Ventura 13.4
Python version 3.9.13
Hi Dominic,
using the most recent version of FoCuS_point (16_202) as well as the FCSfitJS version I run into trouble opening .fcs files from Zeiss machines: Not all measurements are displayed and you cannot dispaly the second channel.
This worked fine in previous versions (here FoCuS_scan_14_74):
I attached two example files (dual-colour, no CC and dual-colour with CC
FCS_files_DualColour.zip
)
It just seems like there's something funny about assinging and reading the channels.
Many thanks,
Falk
Hi Dominic,
The name importer has worked to preserve the recordings within the same .fcs file. However, it still couldn't reflect the change in the physical file name e.g. it's still FCS_diagram_1_1. This is important because we'd like to put .fcs file between different experimental groups in the same folder and generate all parameters together. Do you mind to have a look? Many thanks.
Best wishes,
Isaac
Dear Dom,
Many thanks for the new release of the software. We have encountered a few issues that I wanted to bring up. Everything I will talk about is on the "Fit Function" Tab.
1- When I open the program, the parameters windows do not stretch properly (See Picture 1). This makes it difficult to play with the parameters.
2- When I load a correlated fcs or sin file, the y-axis are always fixed between 0 and 1, in the old versions it used to change so that we could immediately see the curves as fcs files start from 1 (See Picture 2).
3- To solve the issue number 2, I go to "Edit Axis..." button and edit the axis, then press "Keep Scale" so that next time I load a file, it does not change, but still when I load a new file, it immediately goes back to 0-1 y-axis format. It is very time-consuming to edit the axis every time.
Best wishes,
Erdinc
Hi Dominic,
I noticed recently that the counts per molecule (calculated by FCS as G(0) * average_counts) is actually in Hz and not kHz as stated when the file parameters are copied into Excel. I attach an example measurement of AlexaFluor488 in water acquired at a Zeiss780. I expect counts per molcule round 25-25 kHz but obtain a thousandfold of that.
Calibration_Dominic.zip
Not a big issue but would be great to have the units corrected or the number divided by 1000.
Many thanks,
Falk
I have the question about big files in the FCS program.
Usually I work with file size around 200 Mb or more.
When I import the file around 100Mb python use around 5Gb of ram. And usually have crashes.
Sometimes I have to correlate files around 2Gb.
I have question about program optimization. Can we do it?
Like put the parameter: work with file in parts by 50Mb.
Thank you
Hi @dwaithe,
Having an issue that when I load .ptu into either 1_15 and 1_16, the software immediately crashes and I get the following error messsage.
unicodedecodeerror 'utf-8' codec can't decode byte 0xb5 in position 38: invalid start byte
I don't get the error in 1_13.
Happy to provide an example file if you want. I've been trying with files from a Leica SP5 using Symphotime 2.4.4874.
I have files in .msr format from the Abberior Imspector software.
Is it possible to include an import function for this format?
Is it possible to include supporting for Pt2 format? ( It is for picoharp 300)
Hi Dominic,
the most recent version of the software seems to crash when I save the fitting parameters to the clipboard. That worked fine with all other FoCuS_point/scan versions I have tried in the past. I encountered the issue in realease 1_15_181
Error message from the console:
Many thanks.
Best,
Falk
Hi Dominic,
I've successfully loaded the FCS data but immediately after I loaded models, the program crashed and shut down. Would you mind to have a look? Many thanks.
Best,
Isaac
Is it possible to add a bit more documentation on how the inputs are given? I was trying to run "auto, autotime = tttr2xfcs (y=t*unit,num=10, NcascStart=1e-6,NcascEnd=1, Nsub=5)" where 't' is the arrival time of photons. However it's not clear what each of these variable means especially 'num'.
Thanks for your time and the code.
Biswajit
correlation_methods.py
uses numpy indexing that causes a VisibleDeprecationWarning
starting NumPy 0.10. In NumPy 0.13, the warning becomes an error (see e.g. here).
I fixed this in PyCorrFit using numpy.where
:
FCS-analysis/PyCorrFit@132991c
Hi Dominic,
Alas, I still get an error on opening .ptu files. This time it's:
Traceback (most recent call last):
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_gui", line 213, in showDialog
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_objects", line 60, in __init__
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\correlation_objects", line 78, in processData
File "C:\cygwin64\home\dominic\build\FCS_point\out00-PYZ.pyz\import_methods", line 137, in ptuimport
AttributeError: 'int' object has no attribute 'astype'
Here's a ptu file of noise from some testing a little while back. It opens with PQ code (in fact using a port of the PQ code to a matlab mex file, see https://github.com/nranthony/TTTR/tree/master/PTU, but same horse, different jockey)
sFCStest_1_TimeHarp_2021-02-14_12-17-43.zip
Thanks in advance for your time.
Neil
Hi Dominic,
our Leica SP8 was coupled to PicoQuant electronics and we used FoCuS_point to correlate and analyse our data. Since we upgraded to FALCON we used the internatl fitting routine. However, we can also export the raw photon data as .ptu-files. It would be super handy to be able to analyse the FCS data offline on a personal computer. Unfortuantely, there seems to be a problem with reading these files into FoCuS.
Under FoCuS_point 1_13_146, the files are read in (and correlated) fine. Unfortunately, gating does not work but is of utmost important for STED-FCS. The error message reads "subPicoObject instance has no attribute 'dTimeArr'
Under the most recent release (1_16_197), the software crashes upon attempting to load a FALCON ptu file. The error message reads "picoObject object has no attribute 'autotime'".
Using the example code from PicoQuant (https://github.com/PicoQuant/PicoQuant-Time-Tagged-File-Format-Demos/blob/master/PTU/Python/Read_PTU.py) and your tttr2xfcs function, I can read, gate and correlate the data from Python. It would of course be awesome to do this again from within the FoCuS GUI.
Here, I attach example files acquired at 40 and 80 MHz WLL repetition rate at our Leica SP8 FALCON exported to .ptu.
FALCON_ptu_examples.zip
Many, many thanks for your help.
Best,
Falk
is there a way to filter the intensity traces before correlation ?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.