User Tools

Site Tools


analysis:nsb2014:week5

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
analysis:nsb2014:week5 [2014/07/20 23:57]
mvdm [Plotting with handles]
analysis:nsb2014:week5 [2018/07/07 10:19] (current)
Line 55: Line 55:
 S = LoadSpikes(cfg) S = LoadSpikes(cfg)
 </​code>​ </​code>​
 +
 +If you are using your own data that has a missing or bad .clusters file, do this:
 +
 +<code matlab>
 +cfg = [];
 +cfg.useClustersFile = 0;
 +S = LoadSpikes(cfg)
 +</​code>​
 +
  
 This should give a data structure containing spike train data: This should give a data structure containing spike train data:
Line 124: Line 133:
  
 This high-frequency osillation (the "​ripple"​) superimposed on a slower oscillation (the "sharp wave") is the signature associated with "​replay"​ events in the hippocampus. We will explore this phenomenon in detail in later modules. This high-frequency osillation (the "​ripple"​) superimposed on a slower oscillation (the "sharp wave") is the signature associated with "​replay"​ events in the hippocampus. We will explore this phenomenon in detail in later modules.
-==== Figure properties and exporting ====+==== Figure properties, handles, ​and exporting ====
  
 (Remember to execute the commands below from your ''​sandbox.m''​ file, not from the command line! That way you can more easily retrieve what you did later.) (Remember to execute the commands below from your ''​sandbox.m''​ file, not from the command line! That way you can more easily retrieve what you did later.)
Line 240: Line 249:
 ☛ Verify your understanding by calling ''​test_fun''​ such that ''​b''​ and ''​c''​ are both set to ''​0''​. Also note what happens when you do ''​test_fun(1,'​B',​1)''​! ☛ Verify your understanding by calling ''​test_fun''​ such that ''​b''​ and ''​c''​ are both set to ''​0''​. Also note what happens when you do ''​test_fun(1,'​B',​1)''​!
  
-==== Assignment ====+A different way of flexibly specifying function inputs is through the use of a ''​cfg''​ (configuration) input. An example of how this works can be seen in the ''​getMUA()''​ function used above.
  
-☛ Implement a function ​''​neuroplot()'' ​as follows:+==== Exercise ==== 
 + 
 +☛ Extend your %%PlotSpikeRaster%% ​function as follows, using either the varargin or cfg strategy, and your knowledge of object handles.
  
 <code matlab> <code matlab>
-function neuroplot(spikes,​csc,​varargin) +required inputs:
-function neuroplot(spikes,​csc,​varargin)+
 % %
-inputs:+spikests object with spike train
 % %
-spikes{nCells x 1} cell array of ts objects (spike train) +optional inputs:
-% csc: {nCSCs x 1} cell array of tsd objects (LFPs)+
 % %
-varargins:+csctsd object with LFP data (bonus points for accepting more than one gracefully)
 % %
-% cscColor: [nCSC x 3] RGB values to plot CSCs, default [] +% cscColor: [nCSC x 3] RGB values to plot CSCs, defaults to red 
-% spikeColor: [nCells x 3] RGB values to plot spikes, ​default []+% spikeColor: [nCells x 3] RGB values to plot spikes, ​defaults to black
 % %
-% evt: [nEvents x 1] event times to plot, default [] +% evt: ts object with event times to plot as vertical linesdefaults ​to none
-% evtColor: [nEvents x 3] RGB values ​to plot events, default []+
 % %
-% interactiveMode:​ boolean to enable/​disable arrow key navigation+% interactiveMode:​ boolean to enable/​disable arrow key navigation ​of time axis
 </​code>​ </​code>​
  
-This function should produce a rasterplot of spikes -- one neuron per row -- with one or multiple LFPs plotted above it, similar to panel Aa of the Dragoi and Tonegawa figure above. The values on the y-axis are not important for now, so you can feel free to hide this axis and rescale everything to look good. (However, if you want to include a scalebar for the LFPs, go ahead!) ​Set the default x range to 2 seconds.+This function should produce a rasterplot of spikes -- one neuron per row -- with one or multiple LFPs plotted above it, similar to panel Aa of the Dragoi and Tonegawa figure above. The values on the y-axis are not important for now, so you can feel free to hide this axis and rescale everything to look good. Set the default x range to 2 seconds.
  
-You can pick a default color to plot everything, but there should be optional arguments to have the user specify a color for each neuron and LFP. +Also, we want to be able to overlay events of interest on this plot (such as times when the animal received reward, or brain stimulation was triggered); these can be simple vertical lines that extend all the way through the plot. You can make up a few event times yourself for testing.
- +
-Also, we want to be able to overlay events of interest on this plot; these can be simple vertical lines that extend all the way through the plot. You can make up a few event times yourself for testing.+
  
 Finally, for data exploration it is helpful to be able to skip through the data with the arrow keys; set it up so that the left and right arrows can be used to scroll left and right. For extra awesomeness,​ add zoom functionality that scales the LFPs when pressing the up and down arrows. Finally, for data exploration it is helpful to be able to skip through the data with the arrow keys; set it up so that the left and right arrows can be used to scroll left and right. For extra awesomeness,​ add zoom functionality that scales the LFPs when pressing the up and down arrows.
  
-☛ When you are satisfied with your work, save a copy in your ''​shared'' ​folder and push it to GitHub. Verify that your version is visible from the web.+☛ When you are satisfied with your work, save a copy in your project ​folder and push it to GitHub. Verify that your version is visible from the web. 
 === Hints === === Hints ===
  
analysis/nsb2014/week5.1405915046.txt.gz · Last modified: 2018/07/07 10:19 (external edit)