2009-09-24  Stephen Eglen  <stephen@gnu.org>

	* R/iit.R (iit.read.spikes): Handle the case when FILENAME is a
	CSV, rather than a .mat file.  This gets around current bug when
	large .mat files are not read on a windows machine.

2009-09-22  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (make.movieframes): Create output directory if it
	doesn't exist.

	* R/iit.R: New file to store code for high-density array (64x64).
	Data from IIT is coming in matlab format, so R.matlab package
	required for processing these data.

	* R/ms_funs.r (spikes.to.ragged.csv): New function.


2009-08-14  Stephen Eglen  <stephen@gnu.org>

	* R/feller.R (filter.channel.names): New function, used to keep or
	remove channels specified by name when reading in data.

	* R/sanger.R: Use TRUE/FALSE, not T/F.

	* R/feller.R (remove.empty.channels): New function to delete
	channels that are empty after reading in data.
	(feller.read.spikes): Use above function.

2009-07-29  Stephen Eglen  <stephen@gnu.org>

	* R/feller.R (feller.read.spikes): New functions to read in data
	from Marla Feller.

2009-07-08  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (calc.burst.summary): Change name of cv.IBI to
	cv.IBIs so that this code matches the field name generated by
	calc.burst.summary.
	

2009-04-06  Stephen Eglen  <stephen@gnu.org>

	* DESCRIPTION (Version): Bump to 0.20 to get Paul and I back in sync.

	* src/sjemea.c (arraywide_autocorr): Remove unused var 'last'.

	* R/networkspikes.R (find.peaks): Increase max.peaks by factor of
	10. Remove T/F.

	* R/corr_index.R (plot.corr.index): Add args 'dot.col', 'show.fit'
	and 'show.ci' to function.

	* R/ms_funs.r (plot.mm.s): Add ylab to arg list.

2009-03-13  Stephen Eglen  <stephen@gnu.org>

	* R/corr_index.R (plot.corr.index): Document 'log=y' usage.

2008-10-09  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (compute.ns): When computing mean and sd,
	ignore any NA entries where half max could not be found.
	(find.halfmax): Check that the half max point to left and right of
	peak can be found, as sometimes it cannot.

2008-08-23  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (movie.postage): Need to pass s struct to legend.
	(plot.rate.mslayout.scale.old): Delete old version of function.

2008-07-20  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R: Tidy up for GPL.

	* R/surprise2.R: GPL.

	* R/general.R (printf): Move here from Poisson surprise.

	* R/networkspikes.R (ns.coincident): Delete old code; GPL.

	* R/corr_index.R (basename2): Remove and use basenamepy instead.

2008-07-17  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (sanger.init): Add code for deskpro15402 at sanger.

2008-04-20  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (sanger.read.spikes): Cope with new format for
	timestamps, i.e. addition of StartStop (now at start of
	spreadsheet).  Move to reading in data all at once.
	

2007-12-18  Stephen Eglen  <stephen@gnu.org>

	* R/general.R (file.or.gz): New function.

	* R/sanger.R (sanger.read.spikes): Use file.or.gz to allow
	filename to be specified w/out .gz suffix.

	* R/ms_funs.r (jay.read.spikes): Possibly read compressed files,
	and handle .sps file accordingly.


2007-12-17  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (handle.gz): New function.
	(make.meafile.cache): Remove any .gz from key.
	(sanger.read.spikes): Use gzfile() to open file, this can natively
	read compresed & uncompressed files.
	(read.cond.tab): Respect using # as a comment character within
	condition tables.

2007-12-14  Stephen Eglen  <stephen@gnu.org>

	* src/sjemea.c (coincident_arr): New function for helping to
	compute network spike identity.

	* R/networkspikes.R (spikes.to.count2): Small bug -- had reference
	to s$... items.
	(ns.identity, ns.coincident): New functions.

2007-08-24  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (find.peaks): Increase max.peaks to 20000

2007-08-10  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (ns.bin.peak): New function: bin the peak
	values into a set of bins (useful for summaries).
	(ns.bin.peak): Check case when p is NULL (no measures).

2007-08-09  Stephen Eglen  <stephen@gnu.org>

	* R/ranksurprise.R (rs.find.burst): New method.

	* R/surprise2.R (spikes.to.bursts): New method: rs.find.bursts
	(rank surprise).

2007-08-08  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (summary.ns): Use the vector "ns$brief" to
	show summary values, rather than recalculating summary values.

2007-07-30  Stephen Eglen  <stephen@gnu.org>

	* DESCRIPTION (Version): 0.16 released.  Cleaned up network spikes
	code.
	

2007-07-27  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (find.peaks): Add column names to peaks matrix.
	(compute.ns): New function: main function to call to compute
	network spikes.
	(spikes.to.count2): New function: return counts as a time series
	object, which is efficient.
	(plot.ns, summary.ns): Summary functions for new "ns" class
	returned by compute.ns.
	(mean.ns): Modified from "show.ns".
	(show.ns): Can show network spikes after mean has been computed
	using mean.ns.

2007-07-23  Stephen Eglen  <stephen@gnu.org>

	* R/logisi.R (logisi.find.burst): add isi.low.

2007-07-21  Stephen Eglen  <stephen@gnu.org>

	* R/logisi.R: New file (from Zheng).

	* R/surprise2.R (spikes.to.bursts): use logisi.par to pass
	parameters.
	

2007-07-17  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (spikes.to.bursts): Add "logisi" as method for
	Zheng to develop.

2007-07-15  Stephen Eglen  <stephen@gnu.org>

	* R/zzz.R (.Last.lib): New function to unload the shared object
	when package is detached.  (Useful for debugging purposes.)

2007-06-21  Stephen Eglen  <stephen@gnu.org>

	* src/sjemea.c (arraywide_autocorr): New function for computing
	autocorrelation of each spike train, and then adding all
	autocorrelations together.
	

2007-06-20  Stephen Eglen  <stephen@gnu.org>

	* src/sjemea.c (ns_count_activity): New function used by
	spikes.to.count.

	* R/networkspikes.R (spikes.to.count): New function to replace
	inefficient R-based spikes.to.count.old.

2007-03-19  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (burstinfo): Use "simplify=FALSE" to ensure that
	sapply returns a list rather than simplifying to a matrix.

2007-03-09  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (calc.burst.summary): New function to provide "one
	line" summary of burst information.

	* R/corr_index.R (basename2): New function.

	* R/sanger.R (mea.op): New function.
	mea.op.dir: new directory.

	* R/networkspikes.R (show.ns): Check case for when network spikes
	were too close to beginning/end of recording; in this case, the
	FWHM and network spike are not collected.

2007-03-06  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (sanger.init): New function.

	* R/networkspikes.R (spikes.to.counts): Return just
	presence/absence (1/0) of spikes within a bin, rather than a count
	of the number of spikes within a bin.

2007-03-04  Stephen Eglen  <stephen@gnu.org>

	* R/corr_index.R (write.corr.indexes): New function: store
	correlation indexes in a file.

	* R/sanger.R (sanger.read.spikes): Update to use new correlation
	index method.
	* R/ncl_mea.R (ncl.read.spikes): ditto.
	* R/ms_funs.r (jay.read.spikes): ditto.

	* R/corr_index.R: new file to store all the functions related to
	correlation index calculation.

2007-02-24  Stephen Eglen  <stephen@gnu.org>

	* R/maxinterval.R (mi.find.bursts): Use cleaner method for merging
	bursts.

	* R/surprise2.R (calc.all.isi): New function.

2007-02-23  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R: Change "first" to "beg" in col name for burst info.
	* R/ms_funs.r (plot.mm.s): Ditto.


2007-02-13  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (make.movieframes): Update to allow this to also
	make the animation when the command "convert" is available. 

2007-02-07  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (find.burst2): New function -- this surprise
	method allows for the SI to drop in phase 1.

	* R/ms_funs.r (jay.read.spikes, sanger.read.spikes): Add min.rate
	arg to remove channels that fire infrequently.
	(plot.cumisi): New function.

	* R/networkspikes.R (find.halfmax): Robust definition, working
	around a given starting point to climb down from the peak.

2007-02-06  Stephen Eglen  <stephen@gnu.org>

	* R/networkspikes.R (find.peaks): Check if any peaks have been
	found -- return NULL if no peaks were found.
	

2007-01-27  Stephen Eglen  <stephen@gnu.org>

	* R/surprise2.R (calc.burst.summary): Just calculate the burst
	summary, so that it can be saved in "s"; use write.csv() to output
	the data frame to a file.

	* R/ms_funs.r (cv.isi): New function.
	(isi): Update to use "diff".
	(plot.cumisi): New function -- useful, but not finished.

	* R/sanger.R (sanger.read.spikes): Return totalspikes = total
	number of spikes in recording.  Compute CV of ISI.

	* R/ms_funs.r (isi): Update to check for 0/1 spikes.

2007-01-22  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (read.cond.tab): Remove rows where Ignore == 1.

2007-01-19  Stephen Eglen  <stephen@gnu.org>

	* R/sanger.R (read.cond.tab): New function for reading  in a
	condition table.

	* R/ms_funs.r (print.mm.s): New function -- default for when an
	object is printed.

	* R/sanger.R (sanger.read.spikes): Change the way that the spikes
	list is created.  Having just one spike train was causing
	problems.  Need to check this for the other reading routines.

2007-01-15  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (sanger.read.spikes,jay.read.spikes): Remove scale
	argument; now included in layout structure.

	* R/ncl_mea.R (ncl.read.spikes): Remove scale argument; now
	included in layout structure.

	* R/ms_funs.r (plot.mm.s): Change mintime/maxtime arguments to
	beg/end.
	Remove jay.ms.lim.x and jay.ms.lim.y and instead move to using the
	"layout" structure.  Old references to electrode layout s$pos
	should now become s$layout$pos.
	(make.spikes.to.frate): Use beg/end to denote time window.
	(make.jay.layout,make.sanger1.layout): New functions to make the
	layout to replace plot.jay.pos().

	* R/ncl_mea.R (ncl.read.spikes): Use beg/end for time window.

	* R/ms_funs.r (spikes.to.rates): Return time.interval too.
	(sanger.read.spikes): Use beg/end for time window.
	(jay.read.spikes): Use beg/end for time window; return
	time.interval.

	* R/ncl_mea.R (mcd.data.to.array): Switch to using beg/end to
	specify time window.

	* R/ms_funs.r (movie.window): Allow movie player to select the beg
	and end of the time to play; do not assume frames/s = 1.

2007-01-12  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (plot.mm.s): fix typo.
	(close.window): New function to stop movie before closing the
	movie widget.

2007-01-09  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (movie.window): New function for displaying Tk
	window for controlling movie display.

2007-01-04  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (plot.mm.s): Fix typo in call to rep.

2007-01-03  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (plot.mm.s): default for whichcells is NULL, to
	indicate that all cells should be plotted.

2006-12-20  Stephen Eglen  <stephen@gnu.org>

	* R/ms_funs.r (spikes.to.rates): Change function so that av.rate
	is calculated here, not in the plotting function.

2002-11-08  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mscom): Add max.cols.

2002-10-15  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mscom): Add "max.cols" to allow all COM traces
	to be drawn in one colour.

2002-10-14  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.rate.mslayout.rad): Simple updates for Retreat
	poster and for figures (e.g. colouring asterisk in COM plots).

2002-09-25  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (corr.do.fit): Add show.ci option for showing the
	confidence intervals to exponential fits.
	(jay.filter.for.min): Was not for case when all spike times should
	be removed.  This version is simpler, and works!

2002-09-20  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.corr.index): Change the label of the x axis to
	"distance (m)".

2002-08-28  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mscom): New argument rel.cex to allow relatize
	size of characters to change.

2002-08-04  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.corr.index): Allow plot title (main) to be
	passed as argument, otherwise, assume a default.

2002-07-02  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.meanfiringrate): Use thinner lines for drawing
	mean firing rate.
	(corr.check.fit): New function - generate exponential data where
	we now params to test the fit.
	(plot.corr.index.fit): New function -- show scatter of correlation
	indices and fit.

2002-06-26  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mm.s): Allow "main" and "for.figure" to be
	passed, for figure generation.
	Reduce line width of spikes to 0.2, makes plots subtler.

2002-06-23  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (xcorr.plot): Change x/y axis code for figures.
	(xcorr.restricted): New option show.poisson to control whether
	mean firing rate of other cell shown.
	(plot.mscom): New argument `label.cells' to allow text to be added
	to the COM plot, to label cells.
	(plot.rate.mslayout.rad): New argument `show.time' to control
	whether time is displayed above plot.

	* R/ms_funs.r. xcorr.plot.xaxistimes: New global variable.

2002-06-16  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r: jay.ms.lim.x and y: new variables storing the size
	of Jay's MEA.
	(centre.of.mass.wt2): New function for weighting centre of mass.

2002-06-14  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (jay.read.spikes): Allow units to be shifted, by
	using the .sps file feature.  The movie functions can now
	take the shifted positions into account.
	(plot.jay.pos): Allow units to be coloured.
	(plot.shifted.jay.pos): New function to draw shifted unit
	positions relative to original units.
	Reverse jay.ms.cmap.
	(centre.of.mass): No need for com.thresh.num and com.thresh.rate.

2002-06-08  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.rate.mslayout.col): New function, to colour-code
	the firing rate.
	(movie.postage): New function to make a postscript plot of movie
	frames.

2002-06-05  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.meanfiringrate): Allow optional beginning and
	end times to be specified (in seconds).
	(fourplot): Add optional log="" part in call to plot.corr.index.
	Do not add another title to the correlation plot.
	(jay.read.spikes): Compute corr indexes only if there is more than
	one spike train -- otherwise we do not have any cells pairs to compare!
	(jay.read.spikes): Time.interval (for calculating firing
	rates) is now an optional argument.

2002-06-04  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mscom): Use square plotting region.
	(show.movie): Provide sensible defaults for beginning and end times.
	(make.spikes.to.frate): Remove the last time break -- so that
	first dimension of rates and times are the same length.
	(rates.to.radii.prop.rad): New function.
	(rates.to.radii): New function.
	(rates.to.radii.prop.area): New function.
	(plot.rate.mslayout): Add options SHOW.COM and SKIP.EMPTY.
	Use rates.to.radii to compute the radius, given firing rate.
	(plot.rate.mslayout.scale): New function to draw "scale bar" for
	converting firing rate to radius.

2002-05-15  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.rate.mslayout): New version of plot.

2002-05-14  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (centre.of.mass): New function.  Need to check that
	it is working fine.
	(draw.spikes): new function to draw one spike train.
	(xcorr.restricted): New function to compute cross-correlations
	over just a narrow region of time.
	(xcorr.plot): Check also for windows terminal.

2002-03-10  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (make.corr.indexes): Use as.double() to prevent
	"integer overflow" errors when both n1, n2 were large.  (in these
	cases, results was NA, so we also check to see that NA is not
	found in the correlation matrix.

2002-03-08  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (make.mi): Make tmax an argument, so that we can
	test multiple values of tmax.

2002-02-26  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (plot.mm.s): Rewrite to use segments(), not lines().
	By default do not label cells.  Allow min time to be greater than 0.
	(jay.read.spikes): Ignore spike times less than min.time and
	greater than max.time, if those arguments set.
	(jay.filter.for.max): New function.
	(jay.filter.for.min): New function.
	(make.corr.indexes): Tmax should really be the time of the last
	spike - time of first spike.
	(make.spikes.to.frate): time.low defaults to the time of the first
	spike stored.

2002-02-15  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (jay.read.spikes): Add parameter IDS so that only
	certain channels can be processed.

2002-02-11  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* R/ms_funs.r (xcorr.plot): Allow plot to display as well as to
	postscript/pdf.
	(crosscorrplots): delete autocorrplots and generalise
	crosscorrplots to make auto-corrs as well.

	* src/sjemea.c (bin_overlap, bin2_overlap): remove unwanted
	variable count.

	* R/ms_funs.r (crosscorrplots): New function to display both auto
	and cross-correlograms.

2002-01-27  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* ms_funs.r (prob.t.cond.r): Check that each histogram has at
	least one entry; else we will divide by zero when normalising 
	the histogram, leading to NA values.
	(read.ms.mm.data.format1): Check that the number of spikes for a
	cell (for each record) is greater than zero.  Previously assumed
	that there would always be at least one spike per cell (per
	record).

2002-01-24  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* ms_funs.r (fuzz.zero): Remove, and use all.equal() instead.

2002-01-16  Stephen Eglen  <eglen@thalamus.wustl.edu>

	* ms_funs.r (bin.distances): New function to bin distances.
	(my.upper): New function to return upper triangular elements of matrix.
	(make.mi): Compute the various distributions for mutual
	information, and return as a list.
	Various clean ups to code.
