A software for sleep analysis in Drosophila


Structure of the files

Structure of the DAD files

The DAD files are binary files compressed using the zip format; in order to access the data one first needs to open the temporary file stored in the zip archive. The zip compression is very effective for this kind of data and the disk saving one can achieve is in the order of 50 times (meaning a file containing 50mb worth of data is automatically stored in a zip archive of 1mb).

The actual datafile is a binary file composed of two structure:

  • a small cPickle dump of a list containing the header data for all the genotypes (cDAM)
  • an iteration of a binary dump of the 4 arrays containing the activity and sleep data and the status of the fly meaning : cDAM.fly, cDAM.fly5min, cDAM.fly30min, cDAM.flyStatus

A file containing data for two genotypes will have the following information stored in the file:

from byte 0 to byte X:

[[mon0, sch0, ech0, genotype0, comment0, smont0, sd0, emont0, eday0, year0], [mon1, sch1, ech1, genotype1, comment1, smont1, sd1, emont1, eday1, year1]]
from byte X to EOF:

cDAM[0].fly; cDAM[0].fly5min; cDAM[0].fly30min; cDAM[0].flyStatus

cDAM[1].fly; cDAM[1].fly5min; cDAM[1].fly30min; cDAM[1].flyStatus

to access the first part of the data (the header) the file has to be open in binary mode for reading then using cPickle.load the content of the header can be stored in a variable. cPickle will automatically determine the size of the header, so the programmer does not need to know the value of X.

Once the header have been read, all other values can be easily calculated, including the respective sizes of all the following arrays.

See the function LoadDADData(filename) in the analysis program for further details on the code.

Comments are closed.

pySolo sign up form

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur excepteur sint occaecat cupidatat non

pySolo login form