\HeaderA{jay.read.spikes}{Read in the .txt file from Neuroexplorer and create a "spikes" data structure.}{jay.read.spikes}
\keyword{math}{jay.read.spikes}
\begin{Description}\relax
Read in .txt file and work out array positions...
\end{Description}
\begin{Usage}
\begin{verbatim}
jay.read.spikes(filename)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] Name of the text file to be read in.
\end{ldescription}
\end{Arguments}
\begin{Value}
Return the data structure 's'.
\end{Value}
\begin{Section}{METHOD}
No fancy tricks used here.  If the data file has information about N
different spike trains, the file has N (tab-separated) columns.  Each
column then gives the time (in seconds?) of each spike.  Different
columns are of different lengths since typically each cell will have a
different number of spikes.

The txt file of spike times can be compressed (with gzip).
\end{Section}
\begin{References}\relax
No references here.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{sanger.read.spikes}{sanger.read.spikes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data.file <- system.file("examples", "P9_CTRL_MY1_1A.txt",
                         package = "sjemea")
s <- jay.read.spikes( data.file)
fourplot(s)
s <- jay.read.spikes( data.file, beg=400, end=700)
fourplot(s)
## Not run: 
s <- jay.read.spikes("/home/stephen/ms/jay/p9data.txt")
fourplot(s)                             #summary plot.
s$mi <- make.mi(s)
show.prob.t.r(s)                        #conditional distributions.
## End(Not run)

## Not run: crosscorrplots(s, autocorr=T, tmax=3, nbins=100,
               xcorr.nrows=3, xcorr.ncols=3) #plot autocorrs on screen

## Plotting just one cross-correlogram is a slightly different matter:
xcorr.plot( s$spikes[[1]], s$spikes[[2]], "1 v 2")## End(Not run)

\end{ExampleCode}
\end{Examples}

