DOI: 10.17617/3.ornkvi
title: Encoding of mixtures in a simple olfactory system

description: &lt;h2&gt;Folder Contents&lt;/h2&gt;
&lt;h3&gt;Code&lt;/h3&gt;
The code tree is rooted at `code`. It contains three folders:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; &lt;i&gt;`util`&lt;/i&gt;: Contains general utility functions.&lt;/li&gt;
&lt;li&gt; &lt;i&gt;`common`&lt;/i&gt;: Contains commonly used functions for analysis and plotting of the data.&lt;/li&gt;
&lt;li&gt; &lt;i&gt;`figures`&lt;/i&gt;: Contains directories containing code for figures 2-8. &lt;/li&gt;
&lt;li&gt;`figures/figures[2-8]`: Each directory contains
 &lt;ul&gt;
 &lt;li&gt; &lt;i&gt;`MakeFigures.m`&lt;/i&gt;: Used to plot the panels for the figure.&lt;/li&gt;
 &lt;li&gt;Zero or more subdirectories containing code for computing and plotting specific panels.&lt;/li&gt;
 &lt;i&gt;`ProcessData.m`&lt;/i&gt;: Contained by each subdirectory, and used to recompute all the of the data for the associated panel.&lt;/li&gt;
 &lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
 
&lt;h3&gt;Data&lt;/h3&gt;
The data tree is rooted at `data`. It also contains three folders:
&lt;ul&gt;
&lt;li&gt;&lt;i&gt; `spt`&lt;/i&gt;: Contains the raw spike times data. &lt;/li&gt;
&lt;li&gt;&lt;i&gt;`odors`&lt;/i&gt;: Contains data about the odors used in the complex mixtures experiments.&lt;/li&gt;
&lt;li&gt; &lt;i&gt;`proc/figures`&lt;/i&gt;: Contains directories for figures 2-8, each containing processed data used to plot the associated figure.&lt;/li&gt;
&lt;li&gt;&lt;i&gt; `proc/figures/figure[2-8]`&lt;/i&gt;: Contains two subdirectories:
&lt;ul&gt;
 &lt;li&gt;&lt;i&gt;`originalData`&lt;/i&gt;: Post-processed data as provided in this package and used to plot the panels in the paper.&lt;/li&gt;
 &lt;li&gt; &lt;i&gt;`recomputedData`&lt;/i&gt;: Post-processed data recomputed by the the `ProcessData` functions. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt; Datasets&lt;/h3&gt;
&lt;p&gt;Spike times from two sets of experiments were analyzed in the paper and have been provided here.&lt;/p&gt;
&lt;h3&gt;Spike Times&lt;/h3&gt;
&lt;p&gt;The spike times provided in &lt;i&gt;`data/spt`&lt;/i&gt; are matrices in &lt;i&gt;'toc'&lt;/i&gt; (trials-odors-cells) format: Each column contains the spikes times of the response of one cell in one trial to one odor. The columns are arranged by iterating over trials, then odors, then cells. For example, if there are T trials, R odors, and C cells, &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Columns 1 to T are the response of cell 1 to odor 1 in consecutive trials, &lt;/li&gt;
&lt;li&gt;Columns T+1 to 2T are its response to odor 2, &lt;/li&gt;
&lt;li&gt;Columns (R-1)T + 1 to RT are its response to odor R, &lt;/li&gt;
&lt;li&gt; Column RT+1 is the response of cell 2 to the first trial of odor 1, &lt;/li&gt;
&lt;/ul&gt;
and so on. Equivalently, if A is a 4-D matrix such that A(n,i,j,k) is the time of the n'th spike in the response in trial i of odor j of cell k, then &lt;br/&gt;

 Atoc = reshape(A, [], T * R *C);&lt;br /&gt;
 A = reshape(Atoc, [], T, R, C);&lt;br /&gt;

&lt;p&gt;The columns of the the toc matrices contain the actual spike times. If a cell produced fewer spikes than the length of the column, the remainder of the column is set to zero. This could in principle be problematic if cells also tend to produce spikes at exactly t = 0, but this is very rare because odor onset is at t = 2.0 seconds and the baseline period is long (&gt; 10 seconds). The function &lt;i&gt;`ConvertSpikeTimesFromSparseToFull`&lt;/i&gt; converts the sparse matrices to full by setting the 0 elements to -Inf.&lt;/p&gt;