PYME.contrib.gohlke.fcsfiles module

Read fluorescence correlation spectroscopy (FCS) data files.

Currently only Carl Zeiss(r) ConfoCor(r) RAW and ASCII measurement data files are supported.

Author

Christoph Gohlke

Organization

Laboratory for Fluorescence Dynamics, University of California, Irvine

Version

2013.01.18

Notes

“Carl Zeiss” and “ConfoCor” are registered trademarks of Carl Zeiss, Inc.

The API is not stable yet and is expected to change between revisions.

The use of this implementation may be subject to patent or license restrictions.

This module does not read flow cytometry standard FCS files.

class PYME.contrib.gohlke.fcsfiles.ConfoCor2Raw(filename)

Bases: object

Carl Zeiss ConfoCor2 raw data file.

The LSM 510 META - ConfoCor 2 system: an integrated imaging and spectroscopic platform for single-molecule detection. Weisshart K, Jungel V, and Briddon SJ. Curr Pharm Biotechnol. 2004 Apr;5(2):135-54.

ConfoCor 2 - Description of the Raw Data Format. 03.05.01. www.zeiss.at/C12567BE00472A5C/EmbedTitelIntern/RawData/$File/RawData.pdf

Carl Zeiss Advanced Imaging Microscopy claims a patent on the file format and data compression scheme.

Examples

>>> fcs = ConfoCor2Raw('Sample488.011')
>>> fcs.frequency
20000000
>>> ch0, ch1 = fcs.asarray()
>>> ch1[4812432]
999999833
>>> times, ch0, ch1 = fcs.asarray(bins=1000)
>>> times.shape
(1000,)
>>> ch1[428]
10095
>>> fcs.close()
Attributes
frequencyint

Sampling frequency in Hz.

Read file content and parse into a dictionary.

asarray(count=-1, skip=0, **kwargs)

Read data from file, perform optional binning, and return as arrays.

Parameters
countint (optional)

Number of data words to process. Default: -1 (all words).

skipint (optional)

Number of data words to skip at beginning of stream. Default: 0.

kwargsdict

Optional argument to the fcs_bincount function, specifying size or number of bins.

Returns
timesndarray

If binning, the lower range of the bins in units of seconds. Otherwise (default), the times of the events in detector clock units for each channel.

Bincountsndarray

If binning, the number of events in each bin for each channel.

close()

Close open file.

class PYME.contrib.gohlke.fcsfiles.ConfoCor3Fcs(filename)

Bases: dict

Carl Zeiss ConfoCor3 ASCII data file.

No specification is available. The encoding is ‘Windows-1252’.

Examples

>>> fcs = ConfoCor3Fcs('fluorescein.fcs')
>>> fcs['FcsData']['FcsEntry'][0]['FcsDataSet']['CountRateArray'].shape
(60000, 2)

Read file content and parse into dictionary.

close()
class PYME.contrib.gohlke.fcsfiles.ConfoCor3Raw(filename)

Bases: object

Carl Zeiss ConfoCor3 raw data file.

Based on “Confocor3 Raw Data Specification. 2 May 2007. by efg, Stowers Institute for Medical Research.”

Examples

>>> fcs = ConfoCor3Raw('R1_P1_K1_Ch1.raw')
>>> fcs.filename()
'f5ee4f36488fca2f89cb6b8626111006_R1_P1_K1_Ch1.raw'
>>> fcs.frequency
20000000
>>> times = fcs.asarray()
>>> times[10858]
1199925494
>>> times, bincounts = fcs.asarray(bins=1000)
>>> times.shape
(1000,)
>>> bincounts[618]
23
>>> fcs.close()
Attributes
measurement_identifierstr

Hex form of 4 32-bit little endian integers without leading 0. It is the same for all channels of the same repetition.

measurement_positionint

Zero based measurement position.

kinetic_indexint

Zero based kinetic index.

repetition_numberint

Zero based repetition_number.

frequencyint

Sampling frequency in Hz.

Read file header.

asarray(count=-1, skip=0, **kwargs)

Read data from file, perform optional binning, and return as array.

Parameters
countint (optional)

Number of data words to process. Default: -1 (all words).

skipint (optional)

Number of data words to skip at beginning of stream. Default: 0.

kwargsdict

Optional argument to the fcs_bincount function, specifying size or number of bins.

Returns
timesndarray

The lower range of the bins in units of seconds, or, if binsize is 0, the times of the events in detector clock units.

bincountsndarray

The number of events in each bin.

close()

Close open file.

filename()

Return normalized file name from file content.