-------------------------------------------------------------------------------- xe-fftpow1 v 31: 11.November.2014 [JRH] -------------------------------------------------------------------------------- Use KISS-FFT functions to produce a power spectrum density output Requires input from a file or standard input, one column only FFT is performed on overlapping chunks of buffered data Power at each frequency is then averaged for entire file Produces two columns: freq, power USAGE: xe-fftpow1 [input] [options] [input]: provide a filename or "stdin" to receive piped data VALID OPTIONS (defaults in []) -asc: is input/output ASCII? (1=YES, 0=NO, BINX binary input is assumed) [1] -sf: sampling frequency (Hz) of the input [1000] -min: lowest frequency to output [default= 2*sf/n or 0.1, whichever is higher] -max: highest frequency to output [default= sf/2] -b: length of buffers (windows) of data passed to FFT function) [-1 = auto] * must be an even number, not necessarily a power of two * by default, auto = 2*(sr/min) * longer window = more detailed output but lower temporal resolution * frequency resolution = sample_frequency / buffer_size -s: number of steps for the sliding window to span one buffer length [2] * e.g. if -b 8 -s 4, the buffer moves by 8/4=2 samples per FFT * NOTE: must be a factor of the buffer length -f: file containing start-samples for windows * this will override the -s option * if unset, windows are automativcally defined to span the data -m: mean-correct data in each window (0=NO, 1=YES) [1] * mean-correction will slow processing * benefit may be seen with ɮ tapers, reducing low-frequency power -t: number of tapers to use, 5 is typical [1] * if set to 0, no tapering is applied * if set to 1, a single Hann taper is applied * otherwise, uses Sleppian (DPSS) tapers, multi-taper method applied -p: order of the tapers, typically 1 to 5, or -1=auto (ntapers+1) [-1] -g: apply Gaussian smoothing to output (avg.spectrum only) (0= none) [0] * note: -g must be 0 or an odd number 3 or larger) -u: set the units for spectrum output [0] 0=peak amplitude (PA) = 2 x sqrt(FFTreal^2 + FFTimag^2)/windowsize 1=RMS .......= PA x (sqrt(2)/2) 2=power......= RMS-squared 3=dB PA......= 20*log10(PA) 4=dB RMS.... = 20*log10(RMS) 5=dB power...= 10*log10(power) -v: set verbocity to quiet (0) report (1) or tapers-only (-1) [0] -o: output average spectrum (0) or matrix of values (1) [0] * NOTE: if set to 1, each line is the spectrum for one buffer * this can be used to plot the spectrum over time EXAMPLES: xe-fftpow1 [input] [options] xe-fftpow1 data.txt -t bin -sf 1500 cat data.bin | xe-fftpow1 stdin -t asc OUTPUT: if -out 0: <frequency> <power> if -out 1: matrix of power values, row=buffer (time), column=frequency if -out 2: <time> <frequency> <power>
-------------------------------------------------------------------------------- xe-fftpow2 v 6: 11.September.2018 [JRH] -------------------------------------------------------------------------------- Use KISS-FFT functions to produce a power spectrum density output Requires input from a file or standard input, one column only FFT is performed on data windows which can overlap Power at each frequency is then averaged for entire file Produces two columns: freq, power USAGE: xe-fftpow2 [input] [options] [input]: binary or single-column ASCII input, filename or "stdin" VALID OPTIONS (defaults in []) -dt: data type [-1] -1 : ASCII 0-9 : uchar,char,ushort,short,uint,int,ulong,long,float,double -sf: sampling frequency (Hz) of the input [1000] -min: min freq. [-1= default= 2*sf/n or 0.1, whichever is higher] -max: max freq. [-1= default= sf/2] -w: samples per FFT window (must be even, -1= scaled to min) [-1] * longer window = detailed output, low temporal resolution * frequency resolution = sample_frequency / window_size -s: steps for the sliding window to span one window length [1] * e.g. if -w 8 -s 4, the window moves by 8/4=2 samples per FFT * NOTE: must be a factor of the window length -scrf: screening file (.ssp) for defining blocks of data [unset] * NOTE: use only to define large blocks of data (minutes) * if unset, single block for entire input is assumed * -o 0: output's mean spectrum for all windows and all blocks * -o 1: each matrix will have a block-header -m: mean-correct data in each window (0=NO, 1=YES) [1] -t: taper type: 0=none, 1=Hann [1] -p: power to raise the taper, higher values increase slope [1] -g: apply Gaussian smoothing to output (avg.spectrum only) [0] * note: -g must be 0 (none) or an odd number 3 or larger) -u: set the units for spectrum output [0] 0=peak amplitude (PA)= 2x sqrt(FFTreal^2 + FFTimag^2)/windowsize 1=PA expressed as decibels 2=RMS .......= PA x (sqrt(2)/2) 3=power......= RMS-squared -v: set verbosity to quiet (0) report (1) or taper-only (-1) [0] -o: output format (0-3) [0] 0= spectrum averaged across windows and blocks 1= matrix of values, row= time (window) column=frequency 2= like (1) but with timestamp in 1st column - time is sample-number relative to input start - this takes into account block-reading (-scrf option) 3= like (2) but with AUC for freq. bands instead of full spectrum delta = 0.5 - 4 Hz theta = 4 - 12 Hz beta = 13 - 30 Hz gamma = 30 - 100 Hz -binout: binary (64-bit double) output (0=NO 1=YES) [0] * NOTE: binary output mean spectra do not include frequencies * NOTE: binary output matrices do not include block separators * NOTE: not available for -o 3 EXAMPLES: xe-fftpow2 [input] [options] xe-fftpow2 data.txt -t bin -sf 1500 cat data.bin | xe-fftpow2 stdin -t asc OUTPUT: if -o 0: <frequency> <power> if -o 1: spectral matrix, row=window (time), column=frequency if -o 2: <time> <spectrum> if -o 3: <time> <deltapower> <thetapower> <betapower> <gammapower>
---------------------------------------------------------------------- xe-filesize1 v 1: 24.March.2019 [JRH] ---------------------------------------------------------------------- Determine binary file size and/or record-count, duration etc USAGE: xe-filesize1 [infile] [options] [input]: binary file name VALID OPTIONS: defaults in [] -sf: sample frequency (Hz) [1] -dt: data type [1] 0: unsigned char 1: signed char 2: unsigned short 3: signed short 4: unsigned int 5: signed int 6: unsigned long 7: signed long 8: float 9: double -head: header-bytes to be excluded from byte-count [0] -nch: number of interlaced channels [1] -verb: verbose output (0=NO 1=YES 999=DEBUG) [0] EXAMPLES: xe-filesize1 data.txt -t 1 OUTPUT: 1st column: lower limit of each bin ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-filter_butterworth1 v 16: 16.March.2019 [JRH] ---------------------------------------------------------------------- Apply a bi-quad Butterworth filter to the input - high- and low-pass filtering performed in sequence - filtering is bidirectional to avoid temporal shifting of data - non-numeric values, NAN or INF will invalidate the output USAGE: xe-filter_butterworth1 [input] [options] [input]: file name or "stdin" comprised of a single column VALID OPTIONS: -dt: type of data [-1] -1 = ascii 0-9= uchar,char,ushort,short,uint,int,ulong,long,float,double -sf: sample frequency (sample/s) [100.000000] -low: low frequency limit, 0=NONE [0] -high: high frequency limit, 0=NONE [0] -res: resonance (0.1 to sqrt(2)=1.4142) [1.4142] NOTE: low values can produce ringing in the output NOTE: high values can dampen the signal -m: de-mean the data (can reduce straight-line artefacts) [0] 0: no de-meaning 1: remove the mean before filtering 2: as above but re-apply the mean after filtering -pad: apply data-padding? (-1=AUTO,0=NO,ɬ=#SAMPLES) [-1] - AUTO: <=n, 200, 1sec, or if -sf<=1, 200 samples - padding duplicates last sample (sample & hold) -op: output padding as well as original data (0=NO,1=YES) [0] -int: interpolate across invalid data (0=NO,exit instead, 1=YES [1] -v: set verbose output (0=NO,1=YES) [0] EXAMPLES: xe-filter_butterworth1 data.txt -t 1 cat temp.txt | xe-filter_butterworth1 stdin -t 3 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-filter_clip1 v5: 16.September.2015 [JRH] ---------------------------------------------------------------------- Apply a clipping filter to the input Clips data at user-defined min/max values Clips data at user-defined min/max values Non-numeric values, NAN or INF will also be "clipped" USAGE: xe-filter_clip1 [input] [options] [input]: file name or "stdin" comprised of a single column VALID OPTIONS: -dt: type of data [-1] -1= ASCII 0-9= uchar,char,ushort,short,uint,int,ulong,long,float,double -dtout:output format (see -dt for options) [-1] -h: for binary input, size of header (bytes) excluded from output [0] -min: minimum valid value [-10] -max: maximum valid value [10] NOTE: if -min or -max are set to NAN, no filtering is performed -newmin: replacement minimum value [-min, by default] -newmax: replacement maximum value [-max by default] -nseq: required number of sequential values meeting criteria [1] -v: set verbose output (0=NO,1=YES) [0] EXAMPLES: xe-filter_clip1 original.txt -max 0 > clipped.txt xe-filter_clip1 original.bin -ascin -1 -dt 8 -max 0 -ascout -1 > clipped.bin ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-filter_FIR1 v 3: 30.April.2016 [JRH] ---------------------------------------------------------------------- FIR filter program source-code Assumes one valid numeric value per input line Non-numeric values will be interpolated across USAGE: xe-filter_FIR1 [input] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -sf: sample frequency (sample/s) [1.000000] -freq: corner freq. (LP,HP) or central freq. (BP, notch) [0.1] -pt: pass type 1=LP, 2=HP, 3=BP, 4=notch [1] -wt: window type (none,kaiser,sync) [kaiser] : windowing helps reduce ripple & other artefacts -bw: bandwidth, for BP and notch only [3] -ntaps: number of taps (51-255 recommended) [41] : 51 gives results similar to Butterworth -beta: transition bandwidth (0-10) for Kaiser or Sinc windows [0] : low values vive sharper cutoffs -out: output 0=coefficients, 1=filtered data [1] -shift: correct for shift (0-2) [2] 0: no correction, data will be shifted forward 1: back-shift data to correct, last-sample-padding added 2: also avoid starting-artefact (add equal front-padding) -bad: alternative value to interpolate across [nan] NOTE: if data also contains NAN,INF or non-numeric values, then these may get used for interpolation EXAMPLES: xe-filter_FIR1 data.txt -t 1 cat temp.txt | xe-filter_FIR1 stdin -t 3 OUTPUT: 1st column: lower limit of each bin 2nd column: value (eg. counts) in that bin ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-filter_notch1 v5: 18.September.2015 [JRH] ---------------------------------------------------------------------- Apply a bidirectional recursive notch filter to the input - filtering is bidirectional to avoid temporal shifting of data - non-numeric values, NAN or INF will invalidate the output USAGE: xe-filter_notch1 [input] [options] [input]: file name or "stdin" comprised of a single column VALID OPTIONS: -dt: type of data [-1] -1= ASCII 0-9= binary uchar,char,ushort,short,uint,int,ulong,long,float,double NOTE: binary input will produce binary (float) output -h: for binary input, size of header (bytes) excluded from output [0] -sf: sample frequency (sample/s) [100.000000] -n: notch (centre of stop-band, Hz) [0] -w: notch width (Hz) [0] -m: de-mean the data before filtering (0=NO, 1=YES) [0] -pad: apply cosine-tapered padding? (-1=AUTO,0=NO,ɬ=SAMPLES) [-1] NOTE: if -low is set, default= 4x the low freq. wavelength NOTE: if -low is not set, default= 1/4 the input length -int: interpolate across invalid data (0=NO,exit instead, 1=YES [1] -op: output padding as well as original data (0=NO,1=YES) [0] -v: set verbose output (0=NO,1=YES) [0] EXAMPLES: xe-filter_notch1 data.txt -t 1 cat temp.txt | xe-filter_notch1 stdin -t 3 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getdelta1 v 2: 3.June.2016 [JRH] ---------------------------------------------------------------------- Produce the change (delta) between consecutive values in a column USAGE: xe-getdelta1 [input] [options] [input]: file name or "stdin", single column of numbers VALID OPTIONS: defaults in [] -t(ype) of numbers: 1=integers 2=float [2] EXAMPLES: xe-getdelta1 data.txt -t 1 cat temp.txt | xe-getdelta1 stdin -t 2 OUTPUT: n-1 delta scores ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getdelta2 v 1: 3.June.2016 [JRH] ---------------------------------------------------------------------- Produce the change (delta) between values in a pair of columns USAGE: xe-getdelta2 [input] [options] [input]: file name or "stdin", double-column of numbers VALID OPTIONS: defaults in [] -t(ype) of numbers: 1=integers 2=float [2] EXAMPLES: xe-getdelta2 data.txt cat temp.txt | xe-getdelta2 stdin OUTPUT: delta scores ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getintervals1 v 3: 9.November.2018 [JRH] ---------------------------------------------------------------------- Get time intervals during which a data condition (min,max) is met USAGE: xe-getintervals1 [input] [options] [input]: input file or "stdin", of format <time> <value> VALID OPTIONS (defaults in []): -min: minimum value [-1.79769e+308] -max: maximum value [1.79769e+308] -imin: min interval length for output [0) -imax: max interval length [unset by default] : will cause longer intervals to be split : set the same as -imin to enforce uniform intervals NOTE: relaxed criteria = fewer intervals, longer summed durations EXAMPLEs: cut -f 1,5 crunch_pos.txt | xe-getintervals1 stdin 0 20 0 xe-getintervals1 pos.txt 0 20 -imin .1 -max .1 OUTPUT: start and end ttimes for valid intervals ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getkey2 v 1: 4.November.2016 [JRH] ---------------------------------------------------------------------- Detect a key's value when the pair are white-space separated - similar to xe-getkey1, but this program won't break quoted text - in other words, place values containing spaces in quotes - for shell input this requires double-quoting values, e.g. '"a b c"' USAGE: xe-getkey2 [input] [key] [options] [input]: file name or "stdin" [key]: the key for which the value is required VALID OPTIONS: -m: key match mode, 1=contains, 2=exact [2] EXAMPLES: xe-getkey2 data.txt RATE echo name Joe greet '"good morning"' | xe-getkey2 stdin greet OUTPUT: key value (the next word on the line after the key) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getkey v 4: 8.September.2015 [JRH] ---------------------------------------------------------------------- Output the value following a keyword on each line - assumes words on each line are white-space delimited unless -d is set USAGE: xe-getkey [input] [key] [options] [input]: file name or "stdin" [key]: the keyword to be matched (any word on the line) VALID OPTIONS: -d: specify alternative delimiter(s) [default is " \t"] -m: keyword match mode, 1=contains, 2=exact [2] -f: output first match only (0=NO 1=YES) [0] EXAMPLES: xe-getkey data.txt RATE cat temp.txt | xe-getkey stdin PHONE -d ":" OUTPUT: keyword value (the next word on the line after the keyword) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getkeycol v 2: 25.January.2021 [JRH] ---------------------------------------------------------------------- Identify the column-number in an ASCII file matching a keyword - will return the column in the first line matchinng the keyword - NOTE: the key does not need to e on the first line USAGE: xe-getkeycol [in] [key] [options] [in]: file name or "stdin" [key]: the keyword to be matched (any word on the line) VALID OPTIONS... -c: case sensitive? (0=no, 1=yes, default=1) -d: characters to use as column-delimiters [ ,\t\n]) - if manually set, every delimiter = new column - otherwise, consecutive delimters are collapsed -s: column-numbering starts with zero or one [1] EXAMPLES: xe-getkeycol data.txt rate -c 0 -d '\t -' cat temp.txt | xe-getkeycol stdin PHONE OUTPUT: column in the first line matching the keyword ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getkeyline1 v 1: 12.January.2018 [JRH] ---------------------------------------------------------------------- Output lines following a key-line containing patterns USAGE: xe-getkeyline1 [input] "[patterns]" [options] [input]: file name or "stdin" [patterns]: CSV list of patterns to match VALID OPTIONS: -o: omit the key-line from output (0=NO 1=YES) [0] -n: number of lines after keyline to output (-1=ALL) [-1] EXAMPLES: xe-getkeyline1 data.txt RATE,VALUE -o 1 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getsamplefreq1 v 1: 15.February.2015 [JRH] ---------------------------------------------------------------------- Determine the sampling frequency from a series of timestamps Uses the median value for the interval between values Non-numerical values, INF, NAN, or blank lines will result in errors USAGE: xe-getsamplefreq1 [input] [options] [input]: file name or "stdin", single column of numbers VALID OPTIONS: defaults in [] -n : maximum numbers to read [1000] -mult : multiplier to convert timestamps to seconds [1] EXAMPLES: xe-getsamplefreq1 data.txt -n 100 cat temp.txt | xe-getsamplefreq1 stdin -n 1000 -m 60 OUTPUT: A single value representing 1 / <median interval> ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-getsequence1 v 1.6: 25.September.2012 [JRH] ---------------------------------------------------------------------- Extract lines of data in which a word-sequence is found in a given column That is, a column on line must match the correct item in the sequence Start & end words can be the same, allowing contiguous sequences Individual elements in contiguous sequences will only be output once. Non-contiguous sequences will be separated by a space USAGE: xe-getsequence1 [input] [col] [mode] [list] [input]: file name or "stdin" [col]: column containing the words of interest [mode]: match mode: "contains" or "exact" [list]: a sequence of up to 64 words to match OUTPUT: Lines for which the set column matches the sequence Last output line reads "# total_sequences: "[total] EXAMPLE: if this is the input file... 1 dog 2 cat 3 pig 4 cow Then executing this command... xe-getsequence1 data.txt 2 exact cat pig cow Will produce this output... 2 cat 3 pig 4 cow # total_sequences: 1 NOTE: Normal redirection to file excludes the total_sequences report ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-hist1 v 14: 9.November.2018 [JRH] ---------------------------------------------------------------------- Produces the values for a histogram Input is a series of numbers - ideally one row or one column Non-numeric and non-normal values (Nan and Inf) will be ignored USAGE: xe-hist1 [input] [options] [input]: file name or "stdin", reads all columns & rows VALID OPTIONS: defaults in []: -t(ype): 1(counts) 2(range 0-1) or 3(probability) [1] -b(ars) in histogram [25] -w(idth) of each bar, overrides "-b" [unset] -min sets bottom end of histogram scale [unset] -max sets upper end of histogram scale [unset] -label: bin-labels identify start(1) middle(2) or end(3) [2] NOTE: - default outputs values for the middle of each bin - for integers this may produce seemingly unusual results - eg. for numbers 1-4, setting -w 1 produces 3 bins: 1-2,2-3 & 3-4, and bin-labels 1.5,2.5 & 3.5 - for integer-bins use -w 1 -max [max+1] -label 1 (e.g.below) EXAMPLES: - decimal numbers of potential range 0-100: xe-hist1 data.txt -min 0 -max 100 - integers ranging from 1-4: xe-hist1 data.txt -w 1 -max 5 -label 1 - piping data to the program: cat temp.txt | xe-hist1 stdin -t 3 OUTPUT: 1st column: bin-label 2nd column: value (eg. counts) in that bin ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-histstats1 v 1.4: 9.November.2018 [JRH] ---------------------------------------------------------------------- Calculate statistics on a histogram USAGE: xe-histstats1 [input] [options] [input]: 2-column input file or "stdin" in format [x],[y] VALID OPTIONS: -xmin: minimum x-value in histogram for inclusion (unset by default) -xmax: maximum x-value in histogram for inclusion (unset by default) -ref: reference for y-values used in AUC calculations [0] 0: reference to zero (use original y-values) 1: reference to line joining ends of curve -d: detrend before calculating statistics (0=NO, 1=YES) [0] -f: output format (0=line, 1=line+header,2=keywords) [2] EXAMPLES: xe-histstats1 data.txt cat temp.txt | xe-histstats1 stdin OUTPUT: N: number of good x-y pairs XMIN: x-value corresponding with the lowest y-value YMIN: the lowest y-value XMAX: x-value corresponding with the highest y-value YMAX: the highest y-value AUC: area under the curve, using polygons formed by connecting values ANEG: the negative area under the curve APOS: the positive area under the curve MEDIAN: the x-value dividing the distributon into two equal halves COM: centre-of-mass = the avg.observation = sum(x*y) / (sum(y) BIAS: d2-score for y-values when x is +ive vs. -ive NOTE: - for MEDIAN & COM, x/y-values are adjusted so all are positive ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-insert1 v 1: 22.November.2018 [JRH] ---------------------------------------------------------------------- Insert into file1 the contents of file2 - default is to simply concatenate file2 to the end of file1 USAGE: xe-insert1 [file1] [file2] [file1]: file to be added to [file2]: file whose contents is to be added VALID OPTIONS: defaults in [] -start: insert when this quoted text is found in file1 [unset] -pos: position to insert (-1=before,1=after) [1] EXAMPLES: xe-insert1 data.txt temp.txt -s1 "# block1" OUTPUT: the desired block of text, sent to stdout ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-interp1.2.c v 4: 30.April.2016 [JRH] ---------------------------------------------------------------------- Interpolate across blank lines, non-numerical data and NaN/Inf values Outputs exactly the same number of lines as the input USAGE: xe-interp1.2.c [input] [options] [input]: single-column data file or stdin VALID OPTIONS (defaults in []): -bad: alternative value to interpolate across [nan] NOTE: if data also contains NAN,INF or non-numeric values, then these may get used for interpolation -v: verbose output (0=no, 1=yes) [0] ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-interpspectrum1 v 1: 02.February.2016 [JRH] ---------------------------------------------------------------------- Interpolate problem-frequencies in a spectrum Typically used to smooth over mains-noise (50 or 60 Hz) artefacts USAGE: xe-interpspectrum1 [input] [options] [input]: file name or "stdin" in format <frequency> <value> VALID OPTIONS: defaults in [] -freq: CSV list of frequencies to interpolate [none by default] -width: width of band around each exclusion-frequency 1 [1] EXAMPLES: xe-interpspectrum1 spectrum.txt -freq 50,100,150 -w 2 OUTPUT: interpolated spectrum ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-keyupdate1 v 1.1: JRH, 24.September.2012 ---------------------------------------------------------------------- Update the value following a key-word in a file If the key-word is not found it will be added Overwrites the original file USAGE: xe-keyupdate1 [filename] [key] [value] VALID OPTIONS: [filename]: file name or "stdin" [key]: the setkeyword to be matched (any word on the line) [value]: the value to be added or updated EXAMPLES: xe-keyupdate1 data.txt RATE 24000 cat temp.txt | xe-keyupdate1 stdin PHONE<PHONE_NUMBER> OUTPUT: updated file ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas2-makecmt1 v 10: 8.October.2012 [JRH] ---------------------------------------------------------------------- Creates a comment (.cmt) file from a .EVtcv file Program indicates key events such as zone entry/exit, reward etc. Tracks changes in active trigger zone (TZ) or reward-zone (RZ) Looks for changes in zone-occpancy (TZ_IN or RZ_IN) Ignores repeated entries into the same zone START_TRACK keyword used to re-zero times & ignore initializations R_WAITING set to 1 results in CORRECT_CHOICE output R_WAITING set to 0 results in REWARD_RETRIEVED output NREWARDS keyword results in REWARD_DELIVERED output USAGE: xe-ldas2-makecmt1 [EVtcv] [EVtcv]: conditioned version of an Ethovision trial-control record VALID OPTIONS: -s: start time (-1 to use START_TRACK) [0] Used to ignore variable initializations NOTE: timestamps are also aligned so this becomes zero EXAMPLES: xe-ldas2-makecmt1 028-120420_02.EVtcv -s 2.0 OUTPUT: 1st column: time 2nd column: event ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas2-pathstats2 v 3: 14.August.2012 [JRH] ---------------------------------------------------------------------- Calculate statistics on paths defined by time windows USAGE: xe-ldas2-pathstats2 [position data] [winfile] [options] [position data]: filename or "stdin", format: <time><x><y> [winfile]: file listing time windows - format <start><stop> VALID OPTIONS (defaults in []): -int: time (s) over which to integrate movement distance [0.4] EXAMPLES: OUTPUT: ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas3-escapelatency1 v 1: 24.September.2012 [JRH] ---------------------------------------------------------------------- Calcualte escape latency from a comment file input Assumes input format = <time><TAB><comment> TONE_ON marks the start of a trial ENTER_Z2 marks when the subject escapes to the platform ENTER_Z2 marks when the subject leaves the platform if the subject is on the platform at trial-start, the result is "NAN" if the subject does not escape before the next trial the result is "OMIT" USAGE: xe-ldas3-escapelatency1 [input] [options] [input]: file name or "stdin" VALID OPTIONS: EXAMPLES: xe-ldas3-escapelatency1 001-120426_00.cmt cat 001-120426_00.cmt | xe-ldas3-escapelatency1 stdin OUTPUT: trial, start-time and escape latency ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clucombine1 v 4: 17.March.2017 [JRH] ---------------------------------------------------------------------- Combines clusters with common refractoriness and similar waveforms - autocor refract= histogram +-2ms spike-count vs. +-15ms - crosscor refract= histogram +-2ms spike-count vs. +-10ms - one-sided t-tests for spiking probability (0-2 vs 2-10ms) - cluster-pairs meeting criteria are combined as they are tested USAGE: xe-ldas5-clucombine1 [in1] [in2] [in3] [arguments] VALID ARGUMENTS (defaults in []): [in1]: timestamps (.clubt) file for a given probe [in2]: cluster-id (.club) file for a given probe [in3]: waveform (.wfm) file a given probe -sign: spike detection, -1=NEG, 1=POS [-1] -pass: set number of passes[1] -hist: output histograms (.hist file) (0=NO 1=YES) [0] -v: verbocity [2] 0= report only, no combining, single pass, all pairs 1= combine only, no report 2= combine + report: - combine criteria: -s: minimum spikes (central histogram) [25] -a: max auto-refractoriness for both clusters [0.02] -ad: max auto-refract. change, relative to worst of pair [0.02] -r: maximum xcor refractoriness (both sides) [0.8] -t: minimum t-score (either side) [3] -p: maximum p-value (either side) [0.5] -w: minimum multi-channnel waveform peak-correlation [0.9750] - signed R-sq. for values at peak, in depth order EXAMPLES: xe-ldas5-clucombine1 file.clubt file.club file.wfm FILE OUTPUT (-v 1 or 2): modified .club file temp_xe-ldas5-clucombine1.club modified .wfm file temp_xe-ldas5-clucombine1.wfm histogram file (optional) temp_xe-ldas5-clucombine1.hist REPORT OUTPUT (-v 0 or 2): c1 c2 a1 a2 nxcor rl tl pl rr tr pr wavecor combine [c1 c2 a1 a2]: cluster IDs and autocorrelation [nxcor]: number of spikes contriibuting to the cross-correlation [rl tl pl]: left-side refractoriness, t-stat & prob. [rr tr pr]: as above for right-hand side [wavecor]: waveform correlation, 5 channels centred on channel with largest mean spike (see -sign) [combine]: combine criteria bit-flag, 1=histogram, 2=wavecor NOTE: must be 3 (both criteria met) to combine ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clucombinelist1 v 1: 4.April.2017 [JRH] ---------------------------------------------------------------------- Combines cluster-pairs using a list USAGE: xe-ldas5-clucombinelist1 [in1] [in2] [in3] [list] [options] [in1]: timestamps (.clubt) file for a given probe [in2]: cluster-id (.club) file for a given probe [in3]: waveform (.wfm) file a given probe [list]: list of cluster-pairs to combine VALID OPTIONS (defaults in []): -verb: verbocity [0] 0= combine only, no report 1= combine + report: EXAMPLES: xe-ldas5-clucombinelist1 file.clubt file.club file.wfm FILE OUTPUT (-v 1 or 2): modified .club file temp_xe-ldas5-clucombinelist1.club modified .wfm file temp_xe-ldas5-clucombinelist1.wfm ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-cluhist1 v 1: 28.July.2017 [JRH] ---------------------------------------------------------------------- Calculate spike-histogram-related statistics for club(t) records - auto- or cross-corerelograms - binsize fixed at 1ms USAGE: xe-ldas5-cluhist1 [infile1] [infile2] [options] [infile1]: .clubt timestamp file [infile2]: .club cluster-id file VALID OPTIONS (defaults in []: -list: CSV list of clusters to analyze [all] -cor: auto-(1) or cross-(2) corellogram? [1] -t: type, 1(counts) 2(range 0-1) or 3(probability) [1] -sf: sample freq. to convert samples to seconds [19531.250] -width: histogram half-width (milliseconds) [50] -bins: override default number of bins (0= 1ms/bin) [0] NOTE: use only for histogram output (-out 0) -z1: zone1 half-width (milliseconds) [15] -z2: zone2 half-width (milliseconds) [2] -skipz: skip cluster zero (0=NO, 1=YES) [0] -out: output (0=histograms, 1=stats) [1] NOTE: for stats, use a window >= +-50ms -verb: verbose output (0=NO 1=YES) [0] OUTPUT (-out 0, histograms): cluster time count OUTPUT (-out 1, statistics): cluster n histn1 histn2 refract mean burst - cluster: cluster id - n: total spikes fired by this cell - histn1: spikes in histogram - histn2: spikes in zone1 - histn3: spikes in zone2 - refract: refractory score (spikes in zone2/zone1) - mean: mean (ms) for positive portion of histogram - burst: burst-firing tendency of the cell (0-1) EXAMPLES: xe-ldas5-cluhist1 data.clu.3 data.res.3 -sf 24000 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clukiller1 v 1: 10.November.2016 [JRH] ---------------------------------------------------------------------- Reset non-refractory or noisy clusters to category zero (noise) Analysis is based on the 100ms autocorellation histogram No reset is if the central +-15ms of the histogram is sparse - refract= ratio of spikes in the central +-2ms vs +-15ms portions - this captures clusters violating refractoriness requirements - noise= variance in the normalized (0-1), differenced histogram - this captures highly temporally-stereotypic artefacts USAGE: xe-ldas5-clukiller1 [clubt] [club] [options] [clubt]: binary file containing club-times (long int) [club]: binary file containing club-IDs (short int) VALID OPTIONS (defaults in []): -sf (sample freq): convert samples to seconds [19531.25] -ks: skip clusters with < this minimum +-15ms spike-count [75] -kr: maximum refractory score [0.0800] -kn: maximum noise score [2] -v: verbocity (0=report only, 1=cull, 2=cull+report) [1] - examples: xe-ldas5-clukiller1 data.club.3 data.clubt.3 -sf 20000 - output: modified .club file ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clukillerlist1 v 1: 3.April.2017 [JRH] ---------------------------------------------------------------------- Reallocates cluster ID's in a .club file USAGE: xe-ldas5-clukillerlist1 [infile1] [infile2] [list] [options] [infile1]: .clubt timestamp file [infile2]: .club cluster-id file [list]: comma-separated list of cluster-id's to kill VALID OPTIONS, defaults in []: -w: specify a waveform file to also be updated [(null)] -kz: remove cluster zero (0=NO 1=YES) [0] EXAMPLES: xe-ldas5-clukillerlist1 data.clubt data.club 4,13,27 OUTPUT: modified .clubt file (temp_xe-ldas5-clukillerlist1.clubt) modified .club file (temp_xe-ldas5-clukillerlist1.club) modified .wfm file (temp_xe-ldas5-clukillerlist1.wfm) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clumatch1 v 1: 2.June.2017 [JRH] ---------------------------------------------------------------------- Match clusters from different clustering runs based on timestamps - how are reference cluster spikes found in comparison clusters? USAGE: xe-ldas5-clumatch1 [clubt1] [club1] [clubt2] [club2] [options] [clubt1]: reference .clubt file [club1]: reference .club file [clubt2]: comparison .clubt file [club2]: comparison .club file VALID OPTIONS: -diff: max offset (samples) between matched timestamps [0] -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-clumatch1 A.clubt A.club B.clubt B.club -diff 5 OUTPUT: [c0] [n] [p] [x1:m1] [x2:m2] [x3:m3] ... etc [c0]: reference cluster ID [n]: spike count for reference cluster [p]: proportion of [n] found in comparison cluster - NOTE: typically 0-1, but may be ɭ x+: comparison cluster ID m+: comparison cluster timestamps matching [c0] ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clurate1 v 1: 24.November.2017 [JRH] ---------------------------------------------------------------------- Calculate firing-rate timecourse for clusters - USAGE: xe-ldas5-clurate1 [clubt] [club] [options] [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) VALID OPTIONS: -clu: screen using CSV list of cluster IDs [unset] -scrf: screen-file (binary ssp) defining bounds for infile1 [unset] -scrl: screen-list (CSV) defining bounds for infile1 [unset] -winsize: density-window-size (seconds) [1.000]: -sf: sample freq to convert winsize to samples [19531.250] -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-clurate1 data.clubt data.club -s 1 -sl 100,200,1500,1600 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-clusort1 v 1: 1.July.2017 [JRH] ---------------------------------------------------------------------- Sort cluster ID's by channel with max-amplitude peak in .wfm file - assumes channels are in depth-order USAGE: xe-ldas5-clusort1 [clubt] [club] [wfm] [options] [clubt]: .clubt timestamp file [club]: .club cluster-id file [wfm]: .wfm waveform file VALID OPTIONS, defaults in []: -sign: wave amplitude sign (1=positive -1=negative) [-1] -low: filter low-cut (0=none) [300] -high: filter high-cut (0=none) [5000] -verb: verbode output (0=NO 1=YES) [1] EXAMPLES: xe-ldas5-clusort1 data.clubt data.club 4,13,27 OUTPUT: modified .club file (temp_xe-ldas5-clusort1.club) modified ..wfm file file (temp_xe-ldas5-clusort1.wfm) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-cofiring1 v 1: 27.November.2017 [JRH] ---------------------------------------------------------------------- Calculate co-firing of cell pairs USAGE: xe-ldas5-cofiring1 [clubt] [club] [ssp] [options] [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) [ssp]: binary start-stop-pair file defining time-windows VALID ARGUMENTS (defaults in []) ... -clu: CSV list of clusters to use [unset] -win: break SSPs into windows of this size (samples, -1=NO) [-1]: -ms: minimum spikes from both cells in a pair across all windows [0] -verb: verbose output (0=NO 1=YES) [0] EXAMPLES: xe-ldas5-cofiring1 data.txt cells_place.txt times.txt cat data.txt | xe-ldas5-cofiring1 stdin list.txt times.txt OUTPUT: c1 c2 cofir totfir ratio r F p c1,c2: cell id's for each pair cofir: sum of spikes from c1+c2 ocurring inside time windows totfir: sum of spikes from c1+c2, regardless of timing ratio: cofiring ratio score [0-1] NOTE: this may be an unreliable scrore - correlates poorly with r, below NOTE: cofir correlates well, but maybe c1*c2 would be better than c1+c2 n: number win time windows r,F,p: Pearson's-r results for c1 vs. c2 clucounts in each window ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-datwavemean1 v 2: 20.July.2017 [JRH] ---------------------------------------------------------------------- Calculate mean waveform from a given trial (all probes) USAGE: xe-ldas5-datwavemean1 [dat] [clubt] [club] [options] [dat]: interlaced binary data file (short int) [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) VALID OPTIONS: defaults in [] -nch: number of channels in input [16] -chl: channel-list (CSV) specifying order of channels [(null)] -chg: CSV list of good (1, default) or bad (0) channels for -chl [(null)] -spklen: samples comprising the waveform on each channel [40] -spkpre: samples before spike-detection event to be included [8] -sr: .dat sample-rate (Hz) [19531.2] -gain: gain (amplification factor) [70] -vmax: maximum voltage [0.8] -out: output: 1=.wfm file, 2=cluster,sample,mean,std.dev [1] OUTPUT: Waveform file, format= [c] [n] [voltages] [c]: cluster id for this probe [n]: number of spikes contributing to the mean waveform [voltages]: series of [nsamps] mean voltages, in uV EXAMPLES: xe-ldas5-datwavemean1 tr01.dat tr01.clubt tr01.club -spklen 32 -spkpre 8
---------------------------------------------------------------------- xe-ldas5-expandclub1 v 1: 1.May.2016 [JRH] ---------------------------------------------------------------------- Restore .club(t) files with sections removed using an SSP file - output is either converted to ASCII or kept in binary form USAGE: xe-ldas5-expandclub1 [clubt] [club] [options] [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) VALID OPTIONS: -scrf: binary ssp-file defining bounds for kept data [unset] -scrl: list (CSV) defining bounds for kept data -out: output format [-1]: -1= ASCII, one timestamp-id pair per line 0= binary files x2 (long,short) temp_xe-ldas5-expandclub1.clubt temp_xe-ldas5-expandclub1.club -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-expandclub1 data.clubt data.club -s 1 -sl 100,200,1500,1600 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-interp2 v 0: 29.November.2018 [JRH] ---------------------------------------------------------------------- Linear interpolation of multi-channel .dat files (signed short) - reads entire file into memory - processes channels in parallel for speed - output is a binary stream - redirect to a file USAGE: xe-ldas5-interp2 [input] [options] [input]: file name or "stdin" - samples are 16-bit short signed integers - a sample refers to a multi-channel set of data VALID OPTIONS: -nch: total number of channels [16] -bad: identify an invalid value (0,-1, or 1=max) [1] - these values will be interpolated across - should be set, as NAN is undefined for integers -min: minimum-number of sequential good values [0] - in each read-block, shorter sequences are set to bad -b: read-block size (multi-channel samples) (0=auto ~64KiB) [0] -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-interp2 old.dat -verb 1 > new.dat cat old.dat | xe-ldas5-interp2 stdin -nch 32 > new.dat ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-packetloss1 29.November.2018 [JRH] ---------------------------------------------------------------------- Calculate time-course of packet-loss in a .dat file Assumes one valid numeric value per input line Non-numeric values will be ignored USAGE: xe-ldas5-packetloss1 [input] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -sf: sample frequency (Hz) [19531.2] -nch: total number of channels [16] -bad: invalid value (0,-1, or 1=SHRT_MAX) [1] -scrf: screen-file (binary ssp) defining inclusion bounds [] -scrl: screen-list (CSV) defining inclusion bounds [] -bin: binning factor (seconds) to apply [1] -verb: verbose output (0=NO 1=YES) [0] EXAMPLES: xe-ldas5-packetloss1 data.txt -t 1 cat temp.txt | xe-ldas5-packetloss1 stdin -t 3 OUTPUT: 1st column: lower limit of each bin 2nd column: value (eg. counts) in that bin ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-packetloss2 23.December.2018 [JRH] ---------------------------------------------------------------------- Calculate total packet-loss in a .dat file - uses channel-0, assumes packet loss will span all channels USAGE: xe-ldas5-packetloss2 [input] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -sf: sample frequency (Hz) [19531.250] -nch: total number of channels [16] -bad: invalid value (0,-1, or 1=SHRT_MAX) [1] -min: minimum-number of sequential good values [0] - in each read-block, shorter sequences are set to bad -scrf: screen-file (binary ssp) defining inclusion bounds [] - NOTE: SSP/sample-numbers output will be inaccurate -scrl: screen-list (CSV) defining inclusion bounds [] - NOTE: SSP/sample-numbers output will be inaccurate -out: output format [1] 1: summary 2: start-stop pairs for lost-data 3: start-stop pairs for good-data 4: sample-numbers of missing data (64-bit long int) -verb: verbose output (0=NO 1=YES) [0] EXAMPLES: xe-ldas5-packetloss2 test.dat > missing.txt xe-ldas5-packetloss2 test.dat -verb 1 | wc -l ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-packetloss3 24.March.2019 [JRH] ---------------------------------------------------------------------- Calculate packet-loss using a lost.ssp file USAGE: xe-ldas5-packetloss3 [input] [options] [input]: binary .ssp file name or "stdin" - defines blocks of lost-packets (start-stop samples) VALID OPTIONS: defaults in [] -sf: sample frequency (Hz) [19531.250] -win: averaging-window size (seconds) [1] -min: minimum-sample (-1=auto) [-1] -max: maximum-sample (-1=auto) [-1] -scrf: screen-file (binary ssp) defining inclusion bounds [] - NOTE: SSP/sample-numbers output will be inaccurate -scrl: screen-list (CSV) defining inclusion bounds [] - NOTE: SSP/sample-numbers output will be inaccurate -out: output [2] 1= sumamry 2= density time-series, using sf,win,min,max -verb: verbose output (0=NO 1=YES) [0] OUTPUT: time %lost ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-placefields1 v 2: 16.March.2019 [JRH] ---------------------------------------------------------------------- Read binary cluster-timestamps (.clubt) and cluster-ids (.club) - output is either converted to ASCII or kept in binary form - use a file or list of boundaries to screen the start-stop pairs - this program does not accept input piped via stdin USAGE: xe-ldas5-placefields1 [clubt] [club] [xyd] [xydt] [options] [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) [xydt]: binary file containing position-times (long int) [xyd]: binary file containing position-values (3x float) VALID OPTIONS: -clu: screen using CSV list of cluster IDs [unset] -scrf: screen-file (binary ssp) defining bounds for infile1 [unset] -scrl: screen-list (CSV) defining bounds for infile1 [unset] -dwell: minimum samples for a dwell-map bin to be valid [0] -con: number of contiguous bins required to keep a bin [0] -vrate: video sample rate (samples/s) [25] -vrange: 4-item CSV list defining xmin,ymin,xmax,ymax [unset] -binsize : size of map-pixels (cm) [173322727] -sx : 2D gaussian smoothing (bins) applied to rate matrix [0] -sy : 2D gaussian smoothing (bins) applied to matrix [0] -st : smoothing type (0,1 or 2) [2] 0= no smoothing 1= smooth dwellmap and spikemap before calculating rate 2= smooth the ratemap -flip: flip position data in y-dimension [0]: -out: output format [4]: 0= position traces only 1= dwelltime density matrix 2= path+spike x/y coordinates 3= spike-density matrix (counts) 4= spike-firing rate (Hz) -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-placefields1 data.clubt data.club -scrl 100,200,1500,1600 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-placestats1 v 3: 21.October.2017 [JRH] ---------------------------------------------------------------------- Perform place-field analysis on a multi-matrix file - this peak starts at the highest-value pixel and propogates outward - diagonal propogation is not permitted - if peak size is below a minimum, another attempt is made - attempts are made until no peak is detected at all USAGE: xe-ldas5-placestats1 [dwell] [rate] [options] [dwell]: dwelltime matrix file [rate]: firing-rate multi-matrix file - matrices separated by "# <id-number>" lines VALID OPTIONS (defaults in []): -vrange: 4-item CSV list defining xmin,ymin,xmax,ymax [unset] -smooth : 2D gaussian smoothing (bins) applied for field-detection [4] -thresh : edge-detection threshold (proportion of peak) [0.25] -size : size threshold (number of pixels, zero=any) [0] -out : output [1] 1: map-pixel statistics are sent to stderr cluster: cell-ID rmax: highest firing-rate pixel rmean: firing-rate mean rbase: firing rate 10th-percentile - "background" rate rmed: firing-rate 50th-percentile rpeak: firing rate 97.5th percentile - "peak" rate info: information content spar: spatial-sparsity coh: spatial coherence fmax: field-max-rate after smoothing fsize: field-size (pixels) fx: field centroid position (pixel), x-axis fy: field centroid position (pixel), y-axis 2: the final place-field mask sent to stdout 3: both 1 & 2 EXAMPLES: { xe-ldas5-placestats1 matrix.txt -thresh 1 -first 0 > matrix2.txt ; } 2> report.txt ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-readclub1 v 6: 16.March.2019 [JRH] ---------------------------------------------------------------------- Read binary cluster-timestamps (.clubt) and cluster-ids (.club) - output is either converted to ASCII or kept in binary form - use a file or list of boundaries to screen the start-stop pairs - this program does not accept input piped via stdin USAGE: xe-ldas5-readclub1 [clubt] [club] [options] [clubt]: binary file containing cluster-times (long int) [club]: binary file containing cluster-IDs (short int) VALID OPTIONS: -clu: screen using CSV list of cluster IDs [unset] -scrf: screen-file (binary ssp) defining bounds for infile1 [unset] -scrl: screen-list (CSV) defining bounds for infile1 [unset] -sort: sort records by ascending timestamps (0=NO 1=YES) [0] -out: output format [-1]: -2= summary (ID and COUNT) for each cluster -1= ASCII, one timestamp-id pair per line 0= binary files x2 (long,short) temp_xe-ldas5-readclub1.clubt temp_xe-ldas5-readclub1.club -sf: sample freq to calculate firing rates [19531.250] -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-readclub1 data.clubt data.club -s 1 -sl 100,200,1500,1600 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-readdat1v 7: 12.September.2016 [JRH] ---------------------------------------------------------------------- Extract values from an interlaced binary dat file - reads chunks at a time - suitable for very large files - can extract particular channel(s) or a block of data - can invert data and convert from unsigned to signed values USAGE: xe-ldas5-readdat1 [input] [options] [input]: file name or "stdin" - samples are 16-bit short integers - a sample refers to a multi-channel set of data - channel and sample indices are zero-offset - eg. samp2/ch5 of a 16ch input is indexed 2*16+5 VALID OPTIONS: -h: file header size (bytes) [0] -b: read-block size (multi-chan. samples) (0=auto ~64KiB) [0] NOTE: overridden by -dec -s: start reading at this sample (zero-offset) [0] -n: number of samples to read (0=all) [0] -nch: total number of channels [1] -ch: CSV list of channels to extract: 0-(nch-1) [unset= all] -u: convert all data from unsigned (0=NO 1=YES) [0] -adj: adjust non-16-bit data (max-bits, or 0=skip) [0] - NOTE: only applies to data converted from unsigned - e.g. if input was derived from 12bit numbers, then shift the data to maintain the original "zero" -bad: identify an invalid value (0=none -1=-1, 1=max) [0] - protects invalid values from -u conversion - min/max refer to pre-conversion (-u) values - min/max: system-defned values for short integers -rep: replace bad values by most recent good (0=NO 1=YES) [0] -f: flip good data values (0=NO 1=YES) [0] -add: arbitrary value to add to all data [0] -mul: arbitrary value to multiply all data by [1] -dec: decimate to every nth sample (0=NO)[0] -ref: reference channel to be subtracted (-1=none) [-1] -out: output format [0]: 0= ASCII 1= binary interlaced file NOTE: to write channels to separate files, call this program multiple times -verb: verbose output (0=low,1=high,2=highest) [0] EXAMPLES: xe-ldas5-readdat1 data.txt -nch 64 -ch 0,1,2 cat temp.txt | xe-ldas5-readdat1 stdin -nch 64 -ch 62,63 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-readdat2 v 0: 31.January.2019 [JRH] ---------------------------------------------------------------------- Extract & process 1 channel from an interlaced binary dat file - data is read into memory for processing - allows flipping, interpolation, conversion, and downsampling - use this program with caution for very large files USAGE: xe-ldas5-readdat2 [input] [options] [input]: file name or "stdin" - samples are 16-bit short integers - a sample refers to a multi-channel set of buffpoint - channel and sample indices are zero-offset - eg. samp2/ch5 of a 16ch input is indexed 2*16+5 VALID OPTIONS: -nch: total number of channels [1] -ch: channel to extract: 0-(nch-1) [0] -s: start reading at this sample (zero-offset) [0] -n: number of samples to read (0=all) [0] NOTE: if unset, all channels are output -bad: invalid value (0,-1, or 1=SHRT_MAX) [1] -mg: minimum good values in a row to keep data [0] - sequences of less than this will be set to invalid -f: flip good data values (0=NO 1=YES) [0] -int: interpolate across invalid values (0=NO 1=YES) [0] -mean: size of sliding-window used to demean input (0=SKIP) [0] -dec: decimate to every nth sample (0=NO)[0] NOTES: non-integers are allowed,, for precise downsampling : an FIR anti-aliasing filter will be applied - 101 taps, Kaiser window, beta=3 - will require setting -sf (below) - will reduce amplitude for high decimation -sf: sampling frequency (Hz), required for decimation [-1] -con: convert data to float for processing (0=NO 1=YES) [0] -out: output format (0=ASCII, 1=binary) [0]: NOTE: binary out is short (-con 0) or float (-con 1) -verb: verbose output (0=low,1=high,2=highest) [0] EXAMPLES: xe-ldas5-readdat2 buffpoint.txt -nch 64 -ch 0,1,2 cat temp.txt | xe-ldas5-readdat2 stdin -nch 64 -ch 62,63 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-readssp1 v 3: 15.March.2019 [JRH] ---------------------------------------------------------------------- Process binary start-stop-pair (.ssp) files - output is either converted to ASCII or kept in binary form - use a file or list of boundaries to screen the start-stop pairs USAGE: xe-ldas5-readssp1 [input] [options] [input]: binary file containing start-stop pairs, or "stdin" - pairs are 64-bit long integers (signed) - pairs generally refer to sample-numbers VALID OPTIONS: operations shown in execution-order defaults in []: -scr: screen using start-stop boundary pairs [0] 0: no screening (reset to 1 if -scrf or -scrl is set) 1: each pair must fall within one of tinvhe listed bounds 2: each pair must not span any of the listed bounds -scrf: screen-file (binary ssp) defining bounds for infile1 [unset] -scrl: screen-list (CSV) defining bounds for infile1 [unset] -inv: invert SSPs, returning gaps only (0=NO 1=YES) [0] -a: start for a new first-SSP (-1=none) [-1] - adds a record - uses pre-inversion start[0] as new stop[0] -z: stop for a new last-SSP (-1=none) [-1] - adds a record - uses pre-inversion stop[n-1] as new start[n-1] -split: split SSPs into n-sample sub-SSPs (0=none) [0] -div: SSPs divisor (allows alignment to downsampled data) [1] - NOTE: this is only applied at the output stage -com: compress SSPs (0=NO 1=YES) [0] - indicates boundaries in a file merged using the input -out: output format [-1]: -2= summary only (total SSP pairs and duration) -1= ASCII, one start-stop-pair per line 7= binary (long int), start-stop pairs in sequence -verb: set verbocity of output (0=low, 1=high) [0] EXAMPLES: xe-ldas5-readssp1 pairs.ssp -s 1 -sl 100,200,1500,1600,2350,2450 cat thetacycles.ssp | xe-ldas5-readssp1 stdin -s 1 -sf trials.ssp ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-readwave1 v 1: 6.July.2017 [JRH] ---------------------------------------------------------------------- Read waveform file (.wfm) USAGE: xe-ldas5-readwave1 [.wfm file] [options] [.wfm file]: file containing mean waveforms for each cluster VALID OPTIONS: defaults in [] -low: filter low-cut (0=none) [0] -high: filter high-cut (0=none) [0] -clust: restrict output to a CSV list of clusters) [unset] - if unset (null), all clusters are output -verb: verbose output (0=NO 1=YES) [0] -out: output format [1] 0= header only 1= .wfm format (header + waveforms & metadata) 2= [cluster] [channel] [time:ms] [value] ...if -out is set to 2... -chan: restrict output to channel-ID (-1 = no restriction) [-1] NOTE: derived from CHANNEL_LIST, not sequence
-------------------------------------------------------------------------------- xe-ldas5-ripdet1 v 1: 6.March.2018 [JRH] -------------------------------------------------------------------------------- Detect ripple oscillations in a binary file (short or float accepted) Based on methodology published by Sullivan & Buzsaki, 2011 A. read, extract the data for each channel, and interpolate B. copy1 (detection): - band-pass filter in the defined ripple range - rectify, smooth, and convert to Z-scores - detect events ɮ SD (edge=0.5 SD) lasting 25-150ms C. copy2 (validation): - high-pass filter (defined by -low and -high) - extract a data chunk centred on each event - FFT on each chunk (100ms window, mode determined by -taps, below) - smooth the mean spectrum for each event (3-point Gaussian) - reject events with a peak outside ripple range - reject events with higher-freq. peaks > 0.5x the ripple peak USAGE: xe-ldas5-ripdet1 [input] [options] [input]: binary input file READ OPTIONS (defaults in []) -dt: type of data (3=short int, 8=float) [3] -nch: total number of channels [16] -ch: specify the channel to detect on (-1 = ALL) [-1] -sf: sampling frequency (Hz) of the input [19531.25] -scrf: screen-file (binary SSP) defining read-chunks [unset] -scrl: screen-list (CSV) defining read-chunks [unset] NOTE: -scrf & -scrl define start/stop sample pairs NOTE: setting any stop to zero indicates read-to-end-of-file DETECTION OPTIONS -riplow: ripple low-frequency boundary [140] -riphigh: ripple low-frequency boundary [220] -b: boxcar smoother half-width (samples: -1= AUTO, 7.5ms) [-1] -emin: threshold (Z-score) for detecting events [2] -emax: max-allowable event size (Z-score) [20] -ampmin: minimum amplitude (spectral AUC) for "good" ripples [0] VALIDATION OPTIONS -low: filter low-cut filter (0=none, -1= riplow/2, minimum=50) [-1] -high: filter high-cut filter(0=none, -1= riphigh*2), maximum=sf/2 [0] -taps: number of tapers (0=none 1=Hann ɭ=multi-taper) [2] 0-1: 6x 100ms sliding windows estimate ripple spectrum >=2: Slepian tapers in a fixed 100ms window (mid-event-centred) -ord: taper order (rate of change to zero) (-1 = auto = taps+1) [-1] -win: size of FFT-window (seconds) - will be adjusted [0.1] -min: min FFT freq. [-1= default= sf/windowsize] -max: max FFT freq. [-1= default= sf/2] -avg: method for spectral averaging (1=arithmetic, 2=adaptive) [2] -g: half-width (samples) for Gaussian smoothing of spectrum only [3] NOTE: -g must be 0 (none) or an odd number >=3) -out: output [4] 0: tapers only 1,2: spectra for all(1) or good(2) events (event,freq,amp) 3,4: times for all(3) or good(4) events (event,start,peak,stop,amp) -wave : file to write ripple waveforms to (NULL=omit) [(null)] -v: set verbosity to quiet (0) or report (1) [0] EXAMPLES: xe-ldas5-ripdet1 [input] [options] xe-ldas5-ripdet1 data.txt -t bin -sf 1500 cat data.bin | xe-ldas5-ripdet1 stdin -t asc
---------------------------------------------------------------------- xe-ldas5-samp2time1 v 1: 5.March.2016 [JRH] ---------------------------------------------------------------------- Calculate the date and time corresponding with a given sample-number USAGE: xe-ldas5-samp2time1 [start] [samp] [options] [start]: file or "stdin", specifying start date/time - this is the date & time for sample-zero - single-column input - format: YYY:MMM:DDD:hh:mm:ss - start times must be rounded to nearest second [samp]: sample number (zero-offset) VALID OPTIONS: defaults in [] -sf: sample frequency [19531.2] EXAMPLES: xe-ldas5-samp2time1 data.txt 20000 -sf 20000 echo 16:12:31:23:59:15 | xe-ldas5-samp2time1 stdin 20000 -sf 20000 OUTPUT: date/time in format YY:MM:DD:hh:mm:ss NOTE: seconds might include a decimal portion ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-screentxt1 v 1: 29.July.2016 [JRH] ---------------------------------------------------------------------- Extract lines if timestamp falls between start-stop-pairs (SSPs) - NOTE: it is assumed timestamps are long-integers (sample-numbers) USAGE: xe-ldas5-screentxt1 [input] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -scrf: screen-file (binary ssp) defining inclusion bounds [] -scrl: screen-list (CSV) defining inclusion bounds [] -ct: column containing long-integer timestamps [1] EXAMPLES: xe-ldas5-screentxt1 data.txt -scrf times_immobile.ssp cat data.txt | xe-ldas5-screentxt1 stdin -scrl 0,1000,30000,31000 OUTPUT: all lines with timestamps falling within one of the SSPs ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-sliceEPSP v 1: 6.September.2018 [JRH] ---------------------------------------------------------------------- Slice-ephys analysis: fibre-volley (FV) and fEPSP - detect stim artefact (ART), FV & fEPSP with separate filters - FV: - find neg or pos inflection between max1 and max2 - find next pos or previous neg inflection, respectively - check that duration <= 1.5*(max2-max1) - otherwise use (max1+max2)/2 as FV start and stop time - fEPSP slope: top half of line connecting FV and fEPSP minimum - looks for most negative slope in 0.5ms sliding windows - seeks from FV +ivity to fEPSP trough - if no FV, use middle of max1-to-max2 (see below) USAGE: xe-ldas5-sliceEPSP [input] [channel] [options] [input]: WinLTP output filename or "stdin" [channel]: channel to analyze- typically AD0 or AD1 VALID OPTIONS: defaults in [] high-cut filter options (Hz) -high1 artefact filter [1500] -high2 fibre-volley & slope-detection filter [1800] -high3 fEPSP filter [250] maximum-times (ms) for phenomena -max1 ART +ivity, also minimum for FV -ivity [1.25] -max2 FV -ivity [2.5] -max3 fEPSP trough [15] other options -pos: FV detected as first(1) or last(2) inflection [2] -fout output trace is filtered? (0=NO 1=high1, 2=high2, 3-high3) [2] -verb sets verbosity (0=simple, 1=verbose) [0] EXAMPLES: xe-ldas5-sliceEPSP 63290358.P0 AD1 -verb 1 cat 63290358.P0 | xe-ldas5-sliceEPSP stdin AD1 SCREEN OUTPUT: artmv fvms fvmv epspms epspmv epspslope FILE OUTPUT: temp_xe-ldas5-sliceEPSP_trace.txt - trace in format <time> <voltage> temp_xe-ldas5-sliceEPSP_nodes.txt - fEPSP & fibre-volley nodes (used for plotting) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-slicePOP v 1: 31.August.2018 [JRH] ---------------------------------------------------------------------- Slice-electrophysiology analysis tool: POP-spike analysis - calculate post-synaptic population-spike AUC and total RMS power - POP-spike is the lowest-value between [min1] and [max1] (below) USAGE: xe-ldas5-slicePOP [input] [channel] [options] [input]: WinLTP output filename or "stdin" [channel]: channel to analyze- typically AD0 or AD1 VALID OPTIONS: defaults in [] -high1 : POP-spike node-detection high-cut filter (Hz) [500] -min1 : earliest time (ms) for pop-spike detection [2.5] - filtering starts at min1/2 to avoid stim-artefact -max1 : latest time (ms) for pop-spike detection [15] -fout : output trace is filtered? (0=NO 1=YES) [1] -verb : sets verbosity (0=simple, 1=verbose) [0] EXAMPLES: xe-ldas5-slicePOP 63290358.P0 AD0 -verb 1 cat 63290358.P0 | xe-ldas5-slicePOP stdin AD0 SCREEN OUTPUT: pop1ms pop1mv pop3ms pop3mv popauc rms FILE OUTPUT: temp_xe-ldas5-slicePOP_trace.txt - trace in format <time> <voltage> temp_xe-ldas5-slicePOP_nodes.txt - POP-spike nodes (used for plotting) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas5-wavestats1 v 1: 24.March.2018 [JRH] ---------------------------------------------------------------------- Calculate waveform statistics from a multi-channel .wfm file USAGE: xe-ldas5-wavestats1 [.wfm file] [options] [.wfm file]: file containing mean waveforms for each cluster VALID OPTIONS: defaults in [] -sign: peak detect sign (-1:negative 1:positive) [-1] -low: filter low-cut (0=none) [300] -high: filter high-cut (0=none) [5000] -thresh: proportion-of-peak at which to calculate width [0.25] OUTPUT: [cluster] [width] [peak] [corr] cluster : cluster-ID n : number of spikes in cluster pchan: channel-ID containing the peak (depends on -sign) peak (uV) : amplitude in pchan at time zero width (ms): for max-peak channel, width at half-amplitude corr : mean Pearson's correlation for all good channel-pairs pmin : minimum value across channels at peak-time pmax : maximum value across channels at peak-time pdiff : the difference between pmax and pmin pratio: pmin/pmax (range 0-1, 1= identical values) - if pminɘ & pmaxɘ, then the ratio is pmax/pmin - if pminɘ & pmaxɬ, -1= max opposite values
---------------------------------------------------------------------- xe-ldas-invalidcmt1 v 2: 14.August.2012 [JRH] ---------------------------------------------------------------------- A tool to select trials with a particular response-time from a series Invalidates pairs of lines in a comment (.cmt) file based on interval That is, if two comments in a row occur at the wrong interval, replace one or both of them with the word "INVALID" Only comment-pairs occurring in the specified sequence will be checked USAGE: xe-ldas-invalidcmt1 [input] [mode] [c1] [c2] [options] [input]: a filefile or "stdin" in [time][TAB][comment] format [mode]: match mode, "contains" or "exact" [c1]: first comment in pair to match [c2]: second comment in pair to match [options] defaults in []: -min: minimum interval between c1 and c2 (0) -max: maximum interval between c1 and c2 (100) -inv: invalidate mode: 0=neither, 1=c1, 2=c2, 3=both [3] OUTPUT: The original input, with some comments replaced with the word "INVALID" NOTE: Start and end words cannnot be the same ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas-medcmt1 v 1: 24.September.2012 [JRH] ---------------------------------------------------------------------- Output event-comments from a Med-Associates file Assumes the input file has subject headers and blocks of [time].[event] - a colon separates labels from header values and data - data blocks are separated by letter-IDs (A: B: C: etc.) - each data line begins with the index-number of the first datum - time is the part of the datum before the decimal - event type (eg 100) comes after the decimal. 000 indicates no event - sample input file... Start Date: 04/26/12 Subject: 9 Experiment: CAR_002 Group: Box Box: 1 A: 0: 965.100 46.100 109.100 135.000 4: 0.000 C: 0: 20.100 26.200 33.100 26.200 4: 33.100 33.200 25.100 0.000 8: 0.000 0.000 0.000 0.000 USAGE: xe-ldas-medcmt1 [input] [options] [input]: Med-Associates input file or "stdin" VALID OPTIONS (defaults in []): -b(lock) to output (a single capital letter) [K] -t(time) multiplier, as time may not be seconds [0.1] e.g. if time is in seconds, set to 1 e.g. if time is in tenths of seconds, set to 0.1 e.g. if time is in tens of seconds, set to 10 EXAMPLES: xe-ldas-medcmt1 data.txt -b A cat temp.txt | xe-ldas-medcmt1 stdin -b K -t 10 OUTPUT: multiple files called [sub]-[yymmdd].med2 (e.g. 009-001231.med2) 1st column: time in seconds 2nd column: event label (eg. 100, 200, etc) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas-readchart1 v 17: 12.March.2015 [JRH] ---------------------------------------------------------------------- Read biosensing data output from Chart program Assumptions: - input has header specifying date, channel names, labels etc. - data format: time ch1 ch2 <etc>... comment1 comment2 <etc> - tab separates columns for time, data and comments - for old CHART files: "#" separates the comment for each channel simultaneous comments for a given channel are disallowed - for newer CHART files: a tab separates comments for each channel "#" preceeds each comment for a given channel Calculates sample frequency based on median sample-interval Will handle comments and channel names with spaces Will correct for time-stamp resets mid-trial by adjusting timestamps after the reset, adding the previous timestamp + 2x the sample interval (ie. times will be made to run in order, with a small gap as a reminder Automatically detemines number of channels from file header Assigns channel-number to output based on the order they appear in the input (001, 002, 003 etc.) USAGE: xe-ldas-readchart1 [input][options] [input]: file name (CHART txt export file with header) VALID OPTIONS (defaults in []): -chancol: column containing channel to be extratced [2] NOTE: time is in col.1, and columns may not map onto channels -channame: name of channel to extract [] NOTE: overrides -chancol. Unset by default -time: output time records? (0=no, 1=yes) [1] EXAMPLES: xe-ldas-readchart1 data.txt -t 1 OUTPUT: [base].[channel].dat : all samples from one channel [base].[channel].cmt : comments (time comment) from one channel [base].time : timestamps for all samples ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-ldas-txt2clb1 v 2: 6.October.2014 [JRH] ---------------------------------------------------------------------- Convert ASCII input stream to 3EG .clb file (16-bit short int) Assumes one valid numeric value per input line Assumes the data type is "waveform" (continuously sampled data) Non-numeric values will be ignored Timestamps assigned to records reflect time of conversion USAGE: xe-ldas-txt2clb1 [input] [options] [input]: file name or "stdin" VALID OPTIONS (defaults in []): -sf: sample rate (Hz) [400] -dur: duration (seconds) of each record [10] -out: output file name, or "stdout" [stdout] -version: define CLB/XML version to use [1] EXAMPLES: xe-ldas-txt2clb1 data.txt -sf 400 -dur 60 -out data.clb cat data.txt | xe-ldas-txt2clb1 stdin -sf 100 -dur 20 -out stdout ----------------------------------------------------------------------
-------------------------------------------------------------------------------- xe-lombscargle1 v 4: 21.August.2018 [JRH] -------------------------------------------------------------------------------- Calculate the Lombs-Scargle periodogram for an autocorrelation USAGE: xe-lombscargle1 [input] [options] [input]: file name or "stdin", format = autocorrelation <interval> <count> - recommend 1using +-500ms autocorellogram with 200 bins (5ms width) - note only intervals ɬ will be considered - input counts will be normalized (mean=0, s.d.=1) VALID OPTIONS: -min: lowest frequency to analyze (-1 = AUTO) [-1] -max: highest frequency to analyze (-1 = AUTO) [-1] -nfreq: number of frequencies to output [100] -bands: comma-separated freq-bands-pairs for ratio calculation [unset] -g: apply Gaussian smoothing (samples) to output [0] - must be an odd integer >=3, or 0= no smoothng) - no effect on calculations (applied to output only) -out: output (1=summary, 2=periodogram) [1] -norm: normalize LS-periodogram (-1=NO, 0=0-1, 1=Zscore) [-1] -verb sets verbosity (0=simple, 1=summary to stderr) [0] EXAMPLES: OUTPUT (-out1): summary stats AUC for each zone Ratio of AUCzone / (AUCzone + AUCtotal) OUTPUT (-out2): 1st column: Frequency 2nd column: Periodogram value [scaling uncertain at this point] 3rd column: Significance (p) --------------------------------------------------------------------------------
---------------------------------------------------------------------- xe-makedata1 v 11: 23.January.2017 [JRH] ---------------------------------------------------------------------- Create a fake data signal at a given frequency with added white noise Includes option to create periodic changes to the signal (events) USAGE: xe-makedata1 [dur] [rate] [options] [dur]: length of output, in seconds (see -end option, below) [rate]: sampling rate in samples/second (e.g. 24000)) VALID OPTIONS (defaults in []): -t: signal type [1] 0: cosine function 1: sine function -p: phase offset (0-180) for signal types 0 and 1, above [0] -f: frequency (Hz) of signal to insert [10] -fsd: standard deviation (Hz) around the main frequency [0] NOTE: for some combinations of -f and rate, it may not be possible to produce a cycle at exacly frequency -f, especially as -f exceeds 1/10 the sample rate. This can be corrected by increasing sampling rate or -vf. -a: amplitude multiplier for signal (base = -1 to 1) [1] -n: amplitude multiplier for noise (base value is 0-1) [0] -g: noise distribution (0=uniform, 1=gaussian) [0] NOTE: generated using Box-Muler method NOTE: for Gaussian noise, -n determines the std.deviation -end: also output data for [dur] timestamp (0=NO 1=YES) [0] -o: output format: 1=<data>, 2=<time><tab><data> [1] OPTIONS FOR DEFINING PERIODIC EVENTS: (changes in frequency, frequency std.dev., amplitude or noise -et: event type (0=none, 1=complete each cycle, 2=force change) [0] NOTE: event type must be ɬ for any events to be generated NOTE: -et 1 may cause variation (ə cycle) in event times NOTE: -et 2 may cause abrupt changes at event boundaries -ed: event duration, in seconds [0.000000] -ei: interval between events, in seconds [0.000000] -ef: signal frequency during event (-1:no change)[-1] -efsd: std.dev of freq. durng event (-1:no change)[-1] -ea: amplitude during event (-1:no change)[-1] -en: noise level during event (-1:no change) [-1] EXAMPLE: 10s @24KHz of 4Hz signal, amplitude x2 for 1s every 5s: xe-makedata1 10 24000 -f 4 -n 0 -et 1 -ei 5 -ed 1 -ea 2 OUTPUT: 1st column: mytime (seconds) 2nd column: fake signal = attenuation*(sinewave-noise) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-makedata2 v 1: 23.January.2017 [JRH] ---------------------------------------------------------------------- Create a fake data signal at a given frequency with added white noise Includes option to create periodic changes to the signal (events) USAGE: xe-makedata2 [dur] [rate] [options] [dur]: length of output, in seconds (e.g. 10) [rate]: sampling rate in samples/second (e.g. 24000)) VALID OPTIONS (defaults in []): -p: pulse duration (s) [1] -i: pulse interval (s) [-1] -a: amplitude multiplier for signal (base = -1 to 1) [1] -n: amplitude multiplier for noise (base value is 0-1) [0] -g: noise distribution (0=uniform, 1=gaussian) [0] NOTE: generated using Box-Muler method NOTE: for Gaussian noise, -n determines the std.deviation -t: signal type [0] 0: half-sine 1: square-wave -end: also output data for [dur] timestamp (0=NO 1=YES) [0] OUTPUT: 1st column: time (seconds) 2nd column: fake signal = attenuation*(sinewave-noise) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-makepairs1 v 1: 16.April.2019 [JRH] ---------------------------------------------------------------------- Make a list of all possible item-pairs USAGE: xe-makepairs1 [in] [options] [in]: input file name or "stdin" in CSV format - NOTE: newlines will be treated as commas VALID OPTIONS: defaults in [] -NONE- EXAMPLES: echo "a,b,c,d" | xe-makepairs1 stdin OUTPUT: CSV pairs of items, newline separated ----------------------------------------------------------------------
************************************************************************** xe-matchlist v 2.0: JRH, 6.June.2010 - Match data-file columns against list-file columns (numeric only, max 15) - Use this to select lines from large data files - USAGE: xe-matchlist [datafile] [listfile] [arguments] - Arguments - defaults in ()... -dc [col1,col2...]: datafile columns which must match (1) -lc [col1,col2...]: listfile columns defining "good" values (1) - Example: match "a.txt" cols 1,4&5 against "list.txt" cols 1,2&3 (respectively): xe-matchlist a.txt list.txt -dc 1,4,5 -lc 1,2,3
---------------------------------------------------------------------- xe-matchtimes1 v 6: 11.February.2014 [JRH] ---------------------------------------------------------------------- Extract lines from a data file falling between start-stop times in timefile infile may specify time in 1 or 2 columns times per line Two columns specify a range which must fall within those in the timefile USAGE: xe-matchtimes1 [datafile] [timefile] [options] [datafile]: filename or "stdin" containing time+data [timefile]: filename containing start-stop times VALID OPTIONS: -d1: time column in infile [1] -d2: optional end-time column in infile (-1 = ignore) [-1] -t1: start-time column in timefile [1] -t2: end-time column in timefile [2] -inv: inverse match - OMIT matching lines (-1=NO,1=YES) [-1] -pad: define a pad string (eg "-1") for out-of-range lines if undefined, out-of-range lines are omitted NOTE: padding only affects non-time columns, so if infile only has time columns, padding will not be apparent! -out destination filename or stdout or stderr (stdout) EXAMPLE: xe-matchtimes1 a.txt times.txt -d1 1 -d2 -1 -out results.txt OUTPUT: [tab]-delimited contents of each line meeting time-criteria
---------------------------------------------------------------------- xe-matchtimes2 v 1: 3 December 2012 ---------------------------------------------------------------------- Extract lines from a data file falling between start-stop times in timefile Output is to a separate file for each window Data may include a time-column or fixed sample-freq. can be assumed Note that if windows overlap, earlier window "grabs" overlapping portion USAGE: xe-matchtimes2 [infile] [timefile] [options] [infile]: data file with or without time-column [timefile]: file containing start and stop times (s) VALID OPTIONS: -d1: time column in infile [1] -sf: sample-freq. (Hz) of input - assumes constant interval [-1] NOTE : if ɬ, this will override -d1 -z: set time of first sample (only used if -sf ɬ) [-1] -t1: start-time column in timefile [1] -t2: end-time column in timefile [2] EXAMPLE: xe-matchtimes2 a.txt times.txt -d1 1 OUTPUT: - a chunk of the data file for each window - files are named temp_xe-matchtimes2_[window#].txt
---------------------------------------------------------------------- xe-math_doublet v 3: 20.January.2019 [JRH] ---------------------------------------------------------------------- Modify column-y by column-x Non-numeric or non-finite fields produce NAN output (line-count preserved) USAGE: xe-math_doublet [input] [options] [input]: file name or "stdin" in format <col1> <col2> VALID OPTIONS: defaults in []: -cx: column containing the modifier [1] -cy: column to be modified [2] -long: assume input is long-integers (0=NO 1=YES) [0] -t type of operation[1] 1: y+x addition 2: y-x subtraction 3: y*x multiplication 4: y/x division -out: output modified column (0) or all columns (1) [0] EXAMPLES: cat datafile.txt | xe-math_doublet stdin -t 2 xe-math_doublet datafile.txt -t 1 OUTPUT: single column result ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-math_index1 24.February.2019 [JRH] ---------------------------------------------------------------------- Identify the index to an item in a list, given the list parameters - use when there's no no index (e.g. time) associated with each value USAGE: xe-math_index1 [min] [max] [n] [val] [min] : minimum value in series [max] : maximum value in series [n] : number of items in series [val] : value for which index is required EXAMPLES: in a 15-second time series sampled at 100Hz... - find index to value at 7 seconds xe-math_index1 0 15 100 7 OUTPUT: - index to the value, rounded down to the nearest integer - NOTE: index is zero-offset ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-math_mod1 v 1: 6 September 2020 [JRH] ---------------------------------------------------------------------- Modify numbers in a table column - No line-length limits - Non-numeric fields will not be modified USAGE: xe-math_mod1 [in] [mode] [options] [in]: file name or "stdin" [mode]: add,sub,mul,div,pow or abs VALID OPTIONS: defaults in [] -c column containing data (0=none, -1=all) [1] -v value to apply using [mode] [0] -long: assume input is long-integers (0=NO 1=YES) [0] Examples: xe-math_mod1 datafile.txt add -c 2 -v 100 cat datafile.txt | xe-math_mod1 stdin add -c 1 -v 25 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-math_round1v 12: 15.July.2016 [JRH] ---------------------------------------------------------------------- Round a column of data to the nearest base (0.1, 15, 230, etc.) Non-numeric fields will not be modified USAGE: xe-math_round1 [infile|stdin] [arguments] Valid arguments - defaults in []: -cy column containing data (0=none, -1=all) [1] -b base for rounding to the nearest [1.00] -d round down instead? (0=NO, 1=YES) [0]] -o output original values as well (0=NO, 1=YES) [0] Examples: cat datafile.txt | xe-math_round1 stdin -cy 1 -b 0.001 xe-math_round1 datafile.txt -cy 2 -b 120 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-math_round2 v 9: 15.July.2016 [JRH] ---------------------------------------------------------------------- Round columns of data to the nearest base (0.1, 15, 230, etc.) NOTE!! This program is not long-line safe! Non-numeric fields will not be modified USAGE: xe-math_round2 [infile|stdin] [arguments] Valid arguments - defaults in []: -c: columns to round, comma-separated, max 256 (default: round all) -b base for rounding to the nearest [1.00] -d round down instead? (0=NO, 1=YES) [0] Examples: cat datafile.txt | xe-math_round2 stdin -c 1,2,9 -b 0.001 xe-math_round2 datafile.txt -b 120 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-math_sum1 v 4: 27.November.2017 [JRH] ---------------------------------------------------------------------- Calculate the sum of a stream of numbers Non-numeric values will be ignored USAGE: xe-math_sum1 [input] [options] [input]: filename or "stdin", single-column of numbers VALID OPTIONS (defaults) in []: -long: assume input is long-integers (0=NO 1=YES) [0] EXAMPLES: xe-math_sum1 data.txt cut -f 1 data.txt | xe-math_sum1 stdin echo "1 2 3 4 5" | xe-math_sum1 stdin OUTPUT: the sum ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixavg2 v 1: 22.January.2019 [JRH] ---------------------------------------------------------------------- Average multiple matrices separated by blank-lines or comments - first matrix defines matrix format (rows & columns) - all matrices must have the same number of rows and columns - non-numeric values will not contribute to the mean - includes option to de-noise and filter the matrix, in that order - these assume columns=time (but see -r option below) USAGE: xe-matrixavg2 [infile] [options] [infile]: file (or "stdin") containing data matrix/matrices - format: space-delimited numbers in columns and rows - matrix separator= blank or lines beginning with "#" - missing values require placeholders (NAN, "-", etc.) DE-NOISING OPTIONS aplied to each matrix: defaults in [] -z: Z-score threshold for noise at each freq (NAN=skip) [nan] -c: Z-score clipping-value, to avoid outliers (-1=noclip) [-1] -s: sign of thesholding (-1=NEG,+1=POS,0=BOTH) [0] -p: % of freq > z needed to invalidate timepoint [25] - e.g. Zɯ for 25% of the spectrum at column 872 -r: 90-deg rotate for analysis (0=NO 1=YES) [0] - use for if input column=freq and row=time - matrix will be rotated back for output NORMALIZATION OPTIONS (applied to rows): defaults in [] -norm: normalization type: [-1] -1: no normalization 0: 0-1 range 1: z-scores (see -n1/-n2) 2: difference from first valid sample (see -n1) 3: difference from mean (see -n1/-n2) 4: ratio of mean (see -n1/-n2) -n1: start of normalization zone (samples) [-1] -n2: end of normalization zone (sample) [-1] - set n1|n2 to -1 to signify first|last valid sample FILTER OPTIONS (applied to rows): defaults in [] -fsr: sample-rate (Hz) [1] -flo: low-frequency cut (0=NONE) [0] -fhi: high-frequency cut (0=NONE) [0] EXAMPLES: xe-matrixavg2 matrix.txt OUTPUT: A single average of the individual matrices ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixbands1 v 1: 3.February.2021 [JRH] ---------------------------------------------------------------------- Extract bands (eg.frequency) from a matrix representing a timeseries - assumes ascending time in rows and frequency in columns - use -rot or -trans options to adjust input accordingly) - bands (AUC for multiple columns) are defined for each time (row) - input should have no labels for row & columns - hence user defines minimum & interval for rows & columns - blank lines or comments ("#") should separate multiple matrices - non-numeric values in a band will produce NaN output USAGE: xe-matrixbands1 [infile] [options] [infile]: file (or "stdin") containing data matrix/matrices - format: space-delimited numbers in columns and rows - missing values require placeholders (NAN, "-", etc.) VALID OPTIONS: defaults in [] -rot: rotate matrix before processing (0,-90,90,180) [0] -trans: transpose matrix (swap x and y axes) (0=NO 1=YES) [0] OPTIONS FOR DEFINING DATA-RANGES, AFTER ROTATING/TRANSLATING: -xmin: leftmost column-value [1.000] -xint: interval between columns [1.000] -ymin: topmost row-value [1.000] -yint: interval between rows [1.000] -ids: CSV list of fields in matrix-headers to use as IDs [unset] - NOTE: ony applies for comment-line ("#") matrix separators - NOTE: fields should be whitespace delimited -bands: CSV band-triplets: name,start,stop - default: delta,.5,4,theta,4,12,beta,12,30,gamma,30,100 EXAMPLES: xe-matrixbands1 in.txt -xmin 0.5 -xint 0.5 -ids 2,4,6 xe-matrixbands1 in.txt -bands delta,.5,.4,theta,4,12 OUTPUT: A long-format timeseries output: ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixcut1 v 1: 2.March.2018 [JRH] ---------------------------------------------------------------------- Extract a single matrix from a multi-matrix file - looks for a unique numeric ID on a line starting with "# " USAGE: xe-matrixcut1 [matrix] [options] [matrix]: file or "stdin" in (multi)matrix format - matrices separated by "# <id-number>" lines VALID OPTIONS (defaults in []): -idcol: zero-offset column on comment-lines holding the ID [1] -id: numeric ID to match [1] -head: output header line (0=NO 1=YES) [1] EXAMPLES: xe-matrixcut1 matrix.txt -id 001 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixcut2 7.February.2021 [JRH] ---------------------------------------------------------------------- Extract matrices (numbers only) from a multi-matrix file - looks for a match with an ID on comment-lines separating matrices - NOTE: max 256 characters are scanned from comment-lines USAGE: xe-matrixcut2 [matrix] [options] [matrix]: file or "stdin" in (multi)matrix format - matrices separated by "# comment" lines VALID OPTIONS (defaults in []): -col : column on comment-lines holding the ID [1] -id : ID to match (if unset, matches all matrices) [] -match : mode (1=partial 2=exact, 3=integer 4=float) [2] -head : output header line (0=NO 1=YES) [1] -p output decimal precision [-1] -2 : %f -1 : %g (minimum required decimals, may truncate to 4 places) >= 0 : value represents decimal precision EXAMPLES: xe-matrixcut2 matrix.txt -col 4 -id dose3 -match 2 xe-matrixcut2 matrix.txt -col 7 -id 0.50 -match 4 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixcut2 24.February.2019 [JRH] ---------------------------------------------------------------------- Extract matrices (numbers only) from a multi-matrix file - looks for a match with an ID on comment-lines separating matrices - NOTE: max 256 characters are scanned from comment-lines USAGE: xe-matrixcut2 [matrix] [options] [matrix]: file or "stdin" in (multi)matrix format - matrices separated by "# comment" lines VALID OPTIONS (defaults in []): -col : column on comment-lines holding the ID [1] -id : ID to match (if unset, matches all matrices) [] -match : mode (1=partial 2=exact, 3=integer 4=float) [2] -head : output header line (0=NO 1=YES) [1] EXAMPLES: xe-matrixcut2 matrix.txt -col 4 -id dose3 -match 2 xe-matrixcut2 matrix.txt -col 7 -id 0.50 -match 4 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixdiff1 v 2: 13.April.2013 [JRH] ---------------------------------------------------------------------- Calculate the difference between two matrices or multi-matrices Second matrix is subtracted from the first First matrix defines the matrix format (rows & columns) All other matrices must have the same format Uses a T-test to mask non-significant differences (set to NAN) Data may be treated as paired or independent - if unpaired, the input-avg. in each bin is calculated first - if paired, the average difference in each bin is used - if paired, each input must contain the same number of matrices - if paired, the order of the matrices specifies the pairing USAGE: xe-matrixdiff1 [infile1] [infile2] [infile1]: file containing reference data matrix/matrices - format: space-delimited numbers in columns and rows - multiple matrices must be separated by a blank line - lines beginning with "#" may also separate matrices - missing values require placeholders (NAN, "-", etc.) [infile2]: the reference matrix is subtracted from this VALID OPTIONS: -p(aired) t-test? (0=NO, 1=YES) [0] -a(lpha) significance level for masking output [0.05] valid alpha levels: 1, .05 .02 .01 .002 .001 -t(ype) of output [1] 1= difference (mean2-mean1) 2= ratio (mean2/mean1) 3= t-statistic on the differences EXAMPLES: xe-matrixdiff1 matrix1.txt matrix2.txt -p 1 -a 0.01 OUTPUT: The average difference between the matrices, masked using -a ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixsub1 2.February.2021 [JRH] ---------------------------------------------------------------------- - Adjust matrix-1 using the corresponding cell in matrix-2 - Both matrices must have identical dimensions - Both should contain only numerical values - no headers or labels - Non-numbers in matrix-2 won't affect the corresponding martix-1 cell - NOTE: consecutive delimiters (tabs or spaces) are treated as one USAGE: xe-matrixsub1 [matrix-1] [mode] [matrix-2] [options] [matrix1] : original matrix filename or "stdin" [mode]: add,sub,mul,div [matrix2] : matrix of modifiers - filename VALID OPTIONS: - none EXAMPLES: xe-matrixsub1 matrix1.txt sub matrix2.txt > newmatrix.txt OUTPUT: A modified matrix, sent to standard output ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixmod1 v 21.October.2017 [JRH] ---------------------------------------------------------------------- Modify a matrix: flip/rotate/transpose,resample,smooth,Fisher-transform,normalize - in that order USAGE: xe-matrixmod1 [input] [options] [input]: file or "stdin" in matrix format VALID OPTIONS (defaults in []): -flip : flip matrix (0=NO, 1= x-flip, 2= y-flip) [0] -t : transpose (0=NO, 1=YES - cannot be combined with rotation) [0] -r : rotation, in degrees (choose 0,+-90,+-180,+-270) [0] -w : width, set (resample) number of columns [0] -h : height, set (resample) number of rows [0] NOTE: expands or averages data in each row/column as needed NOTE: set to zero to leave as-is -sx : 2D gaussian smoothing factor to apply to matrix [0] -sy : 2D gaussian smoothing factor to apply to matrix [0] -pn : preserve NANs when smoothing (0=NO 1=YES) [0] -n : normalization, 0=no, 1=0-1 range, 2=z-scores [0] -f : Fisher z' transformation : 0=no, 1 or 2 = yes [0] transform for r-values set to 1 of numbers range from -1 to 1 set to 2 of numbers range from 0 to 1 EXAMPLES: xe-matrixmod1 matrix.txt -n 0 -sx 1 -sy 2 OUTPUT: An [width]x[height] modified matrix ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixmod2 v 1: 21.September.2020 [JRH] ---------------------------------------------------------------------- - Flip, rotate or transpose a matrix: numeric or non-numeric - note that modifications are performed in the above order - note that flipping in x and y dimensions= 180-deg rotation USAGE: xe-matrixmod2 [infile] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -verb: verbose output (0=NO 1=YES 999=DEBUG) [0] -f : flip matrix (0=NO, 1= x-flip, 2= y-flip) [0] -r : rotation degrees (0,90,180,270 - negative allowed) [0] -t : transpose (0=NO, 1=YES) [0] EXAMPLES: xe-matrixmod2 data.txt -f 2 -r -90 cat temp.txt | xe-matrixmod2 stdin -t 1 OUTPUT: the modified matrix ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixpeak1 v 3: 15.February.2019 [JRH] ---------------------------------------------------------------------- Detect contiguous pixels exceeding a threshold in individual matrices - this peak starts at the highest-value pixel and propogates outward - diagonal propogation is not permitted - if peak size is below a minimum, another attempt is made - attempts are made until no peak is detected at all USAGE: xe-matrixpeak1 [matrix] [options] [matrix]: file or "stdin" in (multi)matrix format - matrices separated by "# <id-number>" lines VALID OPTIONS (defaults in []): -idcol: the column on comment-lines holding the ID [1] -thresh : edge-detection threshold (proportion of peak) [0.25] -size : size threshold (number of pixels, zero=any) [0] -first : output first good peak only (0=NO 1=YES) [1] -out : output [1] 1: peak statistics are sent to stderr 2: the mask sent to stdout 3: both EXAMPLES: { xe-matrixpeak1 matrix.txt -thresh 1 -first 0 > matrix2.txt ; } 2> report.txt ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixsplit1 v 1: 13.October.2014 [JRH] ---------------------------------------------------------------------- Split a large matrix (y-axis= time, top=zero) into blocks Uses a start/stop file to determine which rows Non-numeric values will be ignored USAGE: xe-matrixsplit1 [input] [blockfile] [options] [input]: file name or "stdin" [blockfile]: file containing <start> <stop> pairs defining blocks - <start> and <stop> are row-numbers, starting at zero - blocks must not overlap - however <stop> for one block may be <start> for the next - the <stop> sample is not included in the curent block VALID OPTIONS: -dt: type of data [-1] -1 = ASCII 0 to 9 = uchar,char,ushort,short,uint,int,ulong,long,float,double NOTE: if data is not ASCII, matrix width (-w) must be defined EXAMPLES: OUTPUT: ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-matrixstats1 v 1: 19.March.2018 [JRH] ---------------------------------------------------------------------- Analyze content of a single- or multi-matrix ASCII file USAGE: xe-matrixstats1 [matrix] [options] [matrix]: file or "stdin" in (multi)matrix format - matrices separated by "# <id-number>" lines VALID OPTIONS (defaults in []): -idcol: the column on comment-lines holding the ID [1] -binsize: 4-item CSV list defining xmin,ymin,xmax,ymax [unset] EXAMPLES: xe-matrixstats1 matrix.txt -thresh 1 -first 0 > matrix2.txt ; } 2> report.txt ----------------------------------------------------------------------
******************************************************************** xe-mxcor2 v 2.1: 7.February.2019 [JRH] Calculate spatial correlation between pairs of matrix-format rate maps Reads one CRUNCH matrix output file containing multiple matrices Requires either cell-ids for a pair to analyze, or a pair-list file Outputs the spatial correlation for every cell pair specified USAGE: xe-mxcor2 [matrixfile] [arguments] - valid arguments: -c1: cell 1 of a pair [1] -c2: cell 2 of a pair [1] -cf: file listing cell pairs NOTE: this overrides -c1 and -c2 Examples: xe-mxcor2 crunch_matrix.txt -c1 12 -c2 13 xe-mxcor2 crunch_matrix.txt -cf cellpairs.txt
---------------------------------------------------------------------- xe-nlx2bin v 1: 11.November.2019 [JRH] ---------------------------------------------------------------------- Convert a Neuralynx CSC (.ncs) file to a flat-binary .bin file (float) USAGE: xe-nlx2bin [infile] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -dt: type of data to write [-1] -1: ASCII 0: unsigned char 1: signed char 2: unsigned short 3: signed short 4: unsigned int 5: signed int 6: unsigned long 7: signed long 8: float 9: double -scale: scaling factor to apply to data (eg -1 to invert) [1] -verb: verbose output (0=NO 1=YES) [0] EXAMPLES: xe-nlx2bin data.txt -t 1 cat temp.txt | xe-nlx2bin stdin -t 3 OUTPUT: ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-norm2 v 11: 14.January.2019 [JRH] Normalize or transform data in a specified column Other columns and comment lines and will be output unaltered Maxmimum line length = 1000 characters Non-numbers in the column will be output unaltered but do not affect calculations Values matching the invalid value will also be output as "-" If input is piped to the program, input is sent to a temporary file This allows reconstruction of the input, normalizing only the column of interest USAGE: xe-norm2 [input] [options] REQUIED ARGUMENTS: [input]: a filename or "stdin" VALID OPTIONS: -cy column containing data [1] -p output decimal precision (-1=auto (%f), 0=auto (%g), ɬ=precision) [-1] -n normalization type: [1] -1: no normalization 0: 0-1 range 1: z-scores (uses start/stop) 2: difference from first valid sample (uses start) 3: difference from mean (uses start/stop) 4: ratio of mean (uses start/stop) 5: apply Fisher transform for Pearson's "r" 6: apply reverse Fisher transform for Pearson's "r" 7: log-transform input (log base-10) -start: start of normalization range (from 0, for options 1-4) [-1] -stop: end of normalization range (from 1, for options 1-4) [-1] NOTE: stop = sample just AFTER the last to be included -1 = auto (first valid sample, respectively = first valid sample for start = last valid sample +1 for stop -invalid value to be ignored (unset by default) -sub define value to subtract from each datum (unset by default) -div define value to divide each datum by (unset by default) NOTE: setting -sub or -div overrides -n option NOTE: if only -sub was set, -div=1 NOTE: if only -div was set, -sub=0 To preserve input/output line count, remove comments & blank lines first Invalid values and non-normal numbers (NaN, Inf) will be padded with "-" Examples: cat infile.txt | xe-norm2 stdin -cy 2 -n 1 xe-norm2 infile.txt -n 0 -cy 2 -invalid 999 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-norm3 v 1: 19.April.2019 [JRH] ---------------------------------------------------------------------- Normalise repeated-measures data, preserving grouping identifiers - typically used to normalize subject x group x time data - works on 4 input columns: - id1: identifier (float, typically subject) - id2: identifier (float, typically group) - rep: repeated-measure (float, typically time) - val: value to be normalized (float) NOTE! assumes data are sorted by id1,id2 and rep (see below) USAGE: xe-norm3 [in] [options] [in]: input file name or "stdin" VALID OPTIONS: defaults in [] -head: non-comment lines at top of file to pass unaltered [0] -id1: col-no. for id#1 (float), e.g. subject [1] -id2: col-no. for id#2 (float), e.g. group [2] -rep: col-no. for repeated category (float), e.g. time [3] -val: col-no. for values (float) [4] -norm: normalization type: [3] -1: no normalization 0: 0-1 range 1: z-scores (see -n1/-n2) 2: difference from first valid sample (see -n1) 3: difference from mean (see -n1/-n2) 4: ratio of mean (see -n1/-n2) -n1: beginning of normalization zone (units) [0] -n2: end of normalization zone (units) [1] -verb: verbose output (0=NO 1=YES 999=DEBUG) [0] EXAMPLES: xe-norm3 data.txt -t 1 cat temp.txt | xe-norm3 stdin -t 3 OUTPUT: four columns od data : id1,id2,rep, and val(normalised) ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-normrow2 7.April.2019 [JRH] ---------------------------------------------------------------------- Normalize data within each row of input - non-numeric and non-finite values will be ignored - accepted input delimiters: space,tab,comma - output will be tab-delimited USAGE: xe-normrow2 [infile|stdin] [options] VALID OPTIONS: -head: non-comment lines at top of file to pass unaltered [0] -skip: number of columns to skip (preserve) [0] -norm: normalization type: [1] -1: no normalization 0: 0-1 range 1: z-scores (see start/stop) 2: difference from first valid sample (see start) 3: difference from mean (see start/stop) 4: ratio of mean (see start/stop) -start: start of normalization range (-1= first valid) [0] -stop: end of normalization range (-1= last valid) [-1] NOTE: start/stop are samples-after-skip NOTE: stop = sample just AFTER the last to be included EXAMPLES: cat infile.txt | xe-normrow2 stdin -n 1 xe-normrow2 infile.txt -n 0 -invalid -1 ----------------------------------------------------------------------
-------------------------------------------------------------------------------- xe-O2-readchart2 v 3: 19.October.2015 [JRH] -------------------------------------------------------------------------------- Read biosensing data output from Chart program Calculates sample frequency based on median sample-interval Will handle comments and channel names with spaces Corrects time-stamp irregularities from stopping and re-starting recording - timestamps may temporarily jump backwards (jumpback) - timestamp interval may exceed median interval (delays) Automatically detemines number of channels from file header Channel-numbers assigned according to column-order (001,002,003 etc.) Assumptions: - input header specifies ChannelTitle for each column - input format: time<tab>ch1<tab>ch2...<tab>allcomments - multiple comments separated by " #" may be in the last field - example multi-comment for channels 1,5 and 9 (single timestamp): #1 1_TASK ON #5 2_TASK ON #9 3_TASK ON USAGE: xe-O2-readchart2 [input][options] [input]: file name (CHART txt export file with header) VALID OPTIONS (defaults in []): -ch: channel number (1-16) to be extratced [1] -chname: name of channel to extract, overrides -ch [] -time: output time records? (0=no, 1=yes) [1] -tx: correct timestamps? (0=no, 1=jumpbacks, 2=jumpbacks + delays) [2] -int: interpolate non-finite values? (0=no, 1=yes) [0] -mcmt: detect manual comments applied to all channels (0=no, 1=yes) [1] - these comments will begin with #* EXAMPLES: xe-O2-readchart2<PHONE_NUMBER>31.txt -ch 5 OUTPUT: temp_xe-O2-readchart2.time : timestamps temp_xe-O2-readchart2.dat : data samples for specified channel temp_xe-O2-readchart2.cmt : times & comments for specified channel --------------------------------------------------------------------------------
---------------------------------------------------------------------- xe-O2-readmed1 v 1: 5.February.2014 [JRH] ---------------------------------------------------------------------- Convert a Med-Associates file for amperometry data - read subject/date/group/experiment information - output a single data block of particular element numbers - define labels for chosen elements Assumes: - input is white-space delimited - multiple consecutive delimiters are treated as one - leading blank-spaces distinguish section labels from data - input has sections for trial data trial-type definition - data section has multiple fixed-length blocks of trials USAGE: xe-O2-readmed1 [input] [section] [elements] [labels] [options] [input]: Med-Associates input file (.txt) or "stdin" [section]: section containing data [elements]: comma-separated list of elements in [section] to output [labels]: comma-separated list of labels for [elements] VALID OPTIONS (defaults in []): -r : output on a single row (0=NO, 1=YES)[0] EXAMPLES: xe-O2-readmed1 data.txt A: 3,5 ntrials,nhead OUTPUT: [experiment] [subject] [date] [group] [data] ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-O2-readmed2 v 4: 12.June.2018 [JRH] ---------------------------------------------------------------------- Convert a Med-Associates file for amperometry data Assumes: - input is white-space delimited file - multiple consecutive delimiters are treated as one - leading blank-spaces distinguish section labels from data - input has sections for trial data trial-type definition - data section has multiple fixed-length blocks of trials - trials-per-block is defined in the trial-definition section NOTE: trial definition section known to have one extra entry NOTE: this extra should always be trial-type zero USAGE: xe-O2-readmed2 [input] [options] [input]: Med-Associates input file (.txt) or "stdin" VALID OPTIONS (defaults in []): -h : number of header entries in data-section to ignore [11] -s1 : data section [C:] -s2 : trial-definition section [Z:] -r : treat data-blocks as repeated measures (output in separate columns [0] EXAMPLES: xe-O2-readmed2 data.txt -s1 "C:" -s2 "Z:" cat temp.txt | xe-O2-readmed2 stdin -s1 "C:" -s2 "Z:" OUTPUT: [block] [trial] [trialtype] [data] ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-oversample1 v 1: 17.March.2019 [JRH] ---------------------------------------------------------------------- Resample an input, adding points and smoothing (Butterworth filter) - assumes one valid numeric value per input line - non-numeric values will be interpolated USAGE: xe-oversample1 [infile] [options] [input]: file name or "stdin" VALID OPTIONS: defaults in [] -sr: sample-rate (Hz) of input [1000] -mul: multiplier for sample-rate [4] -low: low-cut filter (Hz, 0=NONE) [0] -high: high-cut filter (Hz, -1=AUTO, 0=NONE) [-1] AUTO= sr/2 -verb: verbose output (0=NO 1=YES 999=DEBUG) [0] EXAMPLES: xe-oversample1 data.txt -sr 1000 -mul 4 -low 10 1 cat temp.txt | xe-oversample1 stdin -sr 1000 -mul 2 OUTPUT: higher-resolution, filtered values ----------------------------------------------------------------------
-------------------------------------------------------------------------------- xe-pac2 v 2: 2.March.2018 [JRH] -------------------------------------------------------------------------------- Calculate coherence between two signals using FFT (Kiss-FFT) Assumes data consists of real values only FFT is performed on overlapping windows in which data is de-meaned and tapered USAGE: xe-pac2 [inA] [inB] [options] [inA]: file containing the low, modulating frequency [inB]: file containing the high, modulated frequency (can be inA) VALID OPTIONS (defaults in []) -dt: data type (-1=ASCII, 0-9=BINARY) [-1] * dt -1: input is assumed to be 1 column * dt 0-9: uchar,char,ushort,short,uint,int,ulong,long,float,or double -sf: sampling frequency of the input, in Hz [1] -min1: bottom of low freq. range [-1 = default= 800/datalength] -max1: top of low freq. range [-1 = default= sr/2] -min2: bottom of high-freq range [-1=default = min1] -max2: top of high-freq range [-1=default = min1] -res: Butterworth filter resonance (0.1 to sqrt(2)=1.4142) [0.5] NOTE: low values = sharper cutoff but produces ringing NOTE: high values = gentle rolloff and dampened signal -Ft: FIR filter number of taps [101] -Fw: FIR filter bandwidth [3] -Fb: FIR filter beta (edge bandwidth 0-10, lower=sharper but more ringing) [10] -Fs: FIR corection for phase-shift (0=NO 1=YES) [1] -Fy: FIR window type (none,kaiser,sync) [kaiser] -f: file containing start-samples for windows * this will override the -s option * if unset, windows are automatically defined to span the data -w: length of data windows passed to FFT function) (0 = auto) [0] * must be an even number, not necessarily a power of two * by default, auto = 2*(sr/min) * larger window = more detailed output but lower temporal resolution * frequency resolution = sample_frequency / buffer_size -s: number of steps for the sliding window to span one buffer length [0] * e.g. if -b 8 -s 2, the buffer moves by 8/2=4 samples per FFT * note: more steps = more data overlap (artificially high coherence) -t: tapering, 0=NO, 1=YES (Hann taper) [0] * note: tapering inflates coherence (same taper applied to both inputs) -p: power calculation method (0=Goertzel, 1=Butterworth+RMS, 2=FIR+RMS) [1] -m: multiplier for high-freq. energy vector window (wavelengths) [7] -a: windows accumulated before calculating coherence (0 = auto) [0] * note: if not 0, must be at least 2 * note: if -o 0 (avg.spectrum), auto value is "all windows" * note: if -o 1 or 2, auto value is smallest of 8 or "all windows" -adj: adjust coherence to correct for accumulation (0=NO 1=YES) [0] -o: output style (0,1, or 2) [0] * 0=average spectrum, 1=time_v_freq matrix, 2=list of columns * note: if set to 1, each line is the coherence for two buffers -g: apply Gaussian smoothing to output (avg.spectrum only) (0= none) [0] * note: -g must be 0 or an odd number 3 or larger) : low values vive sharper cutoffs -v: set verbocity of output to quiet (0) or report (1) [0] EXAMPLES: xe-pac2 [input] [options] xe-pac2 data.txt -sf 24000 cat data.bin | xe-pac2 stdin -sf 1000 -s 8 OUTPUT: if -out 0: <frequency> <coherence> if -out 1: matrix of coherence values, row=buffer (time), column=frequency if -out 2: <time1> <time2> <frequency> <coherence> <time1> and <time2> bound the window in which coherence is calculated
---------------------------------------------------------------------- xe-pad1 v 8: 7.May.2016 [JRH] ---------------------------------------------------------------------- Pad a series of numbers with extra values at the start, end, or both Useful for avoiding edge-effects with filtering, but trim data afterwards Non-numeric values will be assigned to NaN USAGE: xe-pad1 [input] [options] [input]: file name or "stdin" - single column of data VALID OPTIONS (deafulats in []): -n(umber) of padded values to add [5] -t(ype) of padding: 1(beginning) 2(end) or 3(both) [1] -e(dge) treatment: [1] 0: zeros 1: trend to zero rate-of-change 2: reverse-copy, cosine-trended to zero 3: mean of first and/or last n-values 4: sample-and-hold first and/or last value EXAMPLES: xe-pad1 data.txt -n 5 -t 1 cat temp.txt | xe-pad1 stdin -t 2 -n 25 OUTPUT: Padded data in a single column ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-plotmatrix1 2.February.2021 [JRH] ---------------------------------------------------------------------- Produces a postscript "heat-map" plot of a matrix of data If some rows of input have fewer values, the blocks on that row will be stretched to span the entire matrix Non-numeric values will be red for greyscale plots, white otherwise USAGE: xe-plotmatrix1 [filename] [options] VALID OPTIONS (default in [])... [filename]: file name or "stdin" -bw: block-width fixed (0) or adaptive (1) [1] 0 reduces file-size, 1 stretches blocks to fill rows -pal: colour palette (black=min, white=NAN): grey: darkgrey-lightgrey black2grey: black-lightgrey rainbow: blue-green-red viridis: purple-green-yellow plasma: blue-purple-yellow magma: black-purple-cream inferno: black-purple-orange-paleyellow -paln: number of colours in the palette [99] -palrev: reverse order of pallette colours (1=YES,0=NO) [0] -xstep -ystep: set interval between matrix values [nan,nan] - an alternative methods for data range-setting - if "nan", uses -x/ymin and -x/ymax instead - NOTE: works with -x/ymin, but overrides -x/ymax -title: plot title (enclose in quotes) -xlabel -ylabel: axis labels (1 word, use "_" for spaces) -xpad -ypad: pad between data range and plot axes -xint -yint: intervals for x[0] and y[0] tics (0=AUTO -1=OMIT) -xscale -yscale: scale plot in x [0.3] and y [0.3] dimensions -xmin -xmax -ymin -ymax: manually set data range -zmin -zmax: colour-range (NAN=auto) [nan,nan] - add % (eg 95%) to set as a percentile of z-range -zmid: set value for middle colour (non-numeric=auto) [nan] - attempts to equalize range around mid-point - may override zmin,zmax or both -zclip: compress (0) or clip (1) out-of-range values [0] -yflip: flip matrix on y-axis (0=NO, 1=YES) [0] -font: base font size [10] -frame: draw frame at bottom(1) left(2) top(4) right(8) [15] -tics: size of x- and y-tics (negative=outside frame) [-3] -hline: CSV position-list for horizontal dashed lines [unset] -vline: CSV position-list for vertical dashed lines [unset] -uc: user-line colour (0 to -paln, or -1 =white|yellow ) [-1] -us: user-line style (0=dashed, 1=solid) [0] -lwd: line width for data [1] -zx -zy: page offset (-1= default A4 top-left) [-1,-1] -out: output file name [temp_xe-plotmatrix1.ps] EXAMPLES: OUTPUT: postscript file ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-plotmerge1 v 1.6: 23.August.2020 [JRH] ---------------------------------------------------------------------- Merge postscript plot files created by _xe-plottable1 USAGE: xe-plotmerge1 [options] [file list] [file list]: list of file names to merge NOTE: Any option not beginning with a "-" is treated as a file-name VALID OPTIONS: -notrans : remove tranlation from within merged files(0=NO 1=YES) [1] -xo, -yo : x and y origin (top left of page) [60, 655] -xinc, yinc : x and y pixel shifts between plots [140, 200] -xmax, ymax : number of plts across and down a page [4, 5] -scale : set the scale of the combined plot [1] -out : define the output filebase-name [temp_xe-plotmerge1] NOTE: the number before the .ps is the page-number EXAMPLES: xe-plotmerge1 a.ps b.ps c.ps -scale 0.5 -xmax 6 -yo 1200 xe-plotmerge1 -scale 0.5 -xmax 6 -yo 1200 *.ps OUTPUT: - one or more plot files named temp_xe-plotmerge1.[page].ps - e.g. temp_xe-plotmerge1.001.ps ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-plotmerge2 2.February.2021 [JRH] ---------------------------------------------------------------------- Merge postscript files into a single multi-page document USAGE: xe-plotmerge2 [list] [options] [list]: list of file names (space-seperated) to merge VALID OPTIONS (default in [])... -head: include a file-name page-header (0=NO 1=YES) [1] EXAMPLES: xe-plotmerge2 a.ps b.ps c.ps -head 1 OUTPUT: A single multi-paged postscript document, sent to stdout ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-plottable1 15.September.2020 [JRH] ---------------------------------------------------------------------- Produces a postscript plot of data Non-numeric values will be ignored USAGE... xe-plottable1 [filename] [options] VALID OPTIONS (default in [])... [filename]: file name or "stdin" -cx: x-data column (-1 to infer x from sample-number) [1] -cy: y-data column [2] -ce: y-error estimate column [-1] -cf: x-error estimate column [-1] -cg: group ID column [-1] - ID can be numerical or text (no spaces) - if text, group-colour assigned by order of appearance -xmin -xmax -ymin -ymax: manually set data range -xpad -ypad: pad between data range and plot axes (-1=auto) -xint -yint: interval between axis-tics (0=AUTO -1=OMIT) [0 0] -jitter: apply this much jitter (max) to x-values [0] NOTE: do not use with -line option -line: draw line between data points (1=YES,0=NO)[0] -pt: plot type (squ cir tri box bar histo) [cir] -ps: point size (zero to omit) [5] -pf: point fill (0=no, -1=white, 1=datacolour) [1] -colour: adjust colour for lowest group [0] -ebright: adjust error-bar colours up (typically 8,16,24) [0] NOTE: -colour and -ebright only work with default palette -pal: colour palette (default) *.txt: a palette-file with an RGB triplet on each line - blank and comment (#) lines allowed - triplets are 0-1 and whitespace-delimited e.g. .75 0 1.0 default: blk-red-magenta-blue-cyan-green-yel-orange black2grey: black-lightgrey rainbow: blue-green-red viridis: purple-green-yellow plasma: blue-purple-yellow magma: black-purple-cream inferno: black-purple-orange-paleyellow -palrev: reverse order of pallette colours (1=YES,0=NO) [0] NOTE: this does not apply to the default palette -bw: box/bar width, as a fraction of xint (above) [0.75] -ew: error-bar width, fraction of xint (above) [0.375] -bz: boxes and histograms extend to zero? (1=YES,0=NO)[1] -gs: group-shift on x-axis (1=YES,0=NO) [0] NOTE: suitable for box bar or histo plots only NOTE: puts groups side by side centred on x-value NOTE: set -bw to 1/(#groups+1) for this to look nice -xlabel: x-axis label, in quotes [unset] -ylabel: y-ayis label, in quotes [unset] -title: plot title (enclose in quotes) -legend: display legend (0=NO, 1=bottom-left, 2=top-right)[0] -frame: draw frame at bottom(1) left(2) top(4) right(8) [3] -NOTE: these are additive, eg full box=15 [3] -tics: size of x- and y-tics (negative=outside frame) [-3] -hline: CSV list of y-values for horizontal lines [unset] -vline: CSV list of x-values for vertical lines [unset] NOTE: maximum 256 lines of each type NOTE: if > data range, plot range will be expanded -yzero: draw zero-line if y-data spans zero (0=NO 1=YES) [1] -xscale: scale plot in x dimension [0.3] -yscale: scale plot in y dimension [0.3] -font: base font size [10] -lwd: line width for data [1] -lwe: line width for error-bars [0.75] -lwa: line width for axes [1] -lb: break lines in plot [0] (0) no line-breaks in plot (1) if there is missing data or blank lines (2) if a time-series repeats (x[ii]<x[i-1]) -zx, -zy: page offset of the plot [-1,-1] NOTE: -1 = default A4 top-left -out: output file name [temp_xe-plottable1.ps] -verb: verbose output (0=NO, 1=YES) [0] EXAMPLES: xe-plottable1 data.txt -cx 2 -cy 3 -line 1 -title "Sample-1" OUTPUT: - postscript file, default name "temp_xe-plottable1.ps" ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-posstats1 v 3: 8.February.2015 [JRH] ---------------------------------------------------------------------- Analyze a position record USAGE: xe-posstats1 [input] [options] [input]: file name or "stdin" in format <xpos> <ypos> VALID OPTIONS: -sf: sample frequency of input [1] -w: window size (sec) for integrating movement [0.4] -v: minimum velocity (cm/s) for calculating ang.velocity [1.00] -g1: Gaussian smoothing window (sec) for position [0] - applied before calculating velocity, angles and ang.velocity -g2: Gaussian smoothing window (sec) for angles [0] - applied before calculating ang.velocity EXAMPLES: xe-posstats1 data.txt -t 1 cat temp.txt | xe-posstats1 stdin -t 3 OUTPUT: ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-progdep v 5: 26.January.2018 [JRH] ---------------------------------------------------------------------- Check dependencies in a script or program Looks for any mention of a word containing xs-, xe-, or xf_ - allows definition of dependency (e.g. prog=[progname) to be detected, PROVIDED quotes are not used - any other reference to a script/prog/function may be falsely detected, if NOT enclosed in quotes Ignores additional references to the same script/program/function Ignores comments: - all text between /* and */ - everything after the first # or // on a given line Ignores quoted text (between single or double-quotes) Word delimiters: |(){}; "'\t\n USAGE: xe-progdep [file-name] EXAMPLES: xe-progdep xs-myscript ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-random1 v 5: 1.December.2015 ---------------------------------------------------------------------- Produce a series of random integers from [min] to [max] USAGE: xe-random1 [n] [optional arguments] [n]: number of random integers to generate OPTIONAL ARGUMENTS: -g: uniform (0) or Gaussian (1) distribution [1] if uniform: -min: lowest number [0] -max: highest number [1] if Gaussian, mean is zero: -sd: standard deviation of distribution [1] EXAMPLES: xe-random1 60 xe-random1 25 -min -10 -max 10 -r 2 ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-readbinary1 v 8: 13.May.2016 [JRH] ---------------------------------------------------------------------- Extract values from a simple binary file Assumes data (numbers) are all of the same type Allows for presence of a single header Allows extraction of a chunk starting at a particular element USAGE: xe-readbinary1 [input] [options] [input]: file name VALID OPTIONS, defaults in []: -dt: type of data [0] 0: unsigned char 1: signed char 2: unsigned short 3: signed short 4: unsigned int 5: signed int 6: unsigned long 7: signed long 8: float 9: double -h: size of header (bytes) excluded from output [0] -s: start reading at this element (zero-offset) [0] -n: number of elements to read (0=all) [0] NOTE: -s and -n will be internally converted to bytes NOTE: if -n is zero, reads from start to the end -v set verbose mode (0=data only, 1=stderr-report, 2=logfile) [0] EXAMPLES: xe-readbinary1 data.txt -h 500 -s 0 -n 1000 cat temp.txt | xe-readbinary1 stdin OUTPUT: ASCII numbers representing the data ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-readbinary2 v 6: 12.October.2014 [JRH] ---------------------------------------------------------------------- Extract values from a binary file - ASCII output to screen This version assumes data are short-integers (2 bytes) USAGE: xe-readbinary2 [input] [options] [input]: file name or "stdin" VALID OPTIONS: -ch: comma-separated channels to extract (zero to (nch-1), or "all") -nch: total number of channels[1] -s: start reading at this element (zero-offset) [0] -n: number of elements to read (0=all) [0] -sf: sample frequency (Hz): if +ive, times are output [0] NOTE: -s and -n will be internally converted to bytes -b: size of multi-channel data-blocks to read at a time [1000] -asc: ASCII output, 1=ASCII, 0=binary (short int) [1] NOTE: time output is not possible with binary EXAMPLES: xe-readbinary2 data.txt -nch 64 -ch 0,1,2 cat temp.txt | xe-readbinary2 stdin -nch 64 -ch 62,63 OUTPUT: time (if -sfɬ) and data for selected channel ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-readbinary3 v 1: 16.September.2015 [JRH] ---------------------------------------------------------------------- Extract values from a simple binary file Assumes data (numbers) are all of the same type Allows for presence of a single header Allows extraction of a chunk starting at a particular element Data is processed in chunks: reduced memory load but reduced speed USAGE: xe-readbinary3 [input] [options] [input]: file name VALID OPTIONS, defaults in []: -dt: data type [0] 0: unsigned char 1: signed char 2: unsigned short 3: signed short 4: unsigned int 5: signed int 6: unsigned long 7: signed long 8: float 9: double -out: set output type, -1 (ASCII) or 3,5,7,8,9 as above [-1] -b: data block size (numbers to read at a time) [1000] -h: size of header (bytes) excluded from output [0] -s: start reading at this element (zero-offset) [0] -n: number of elements to read (0=all) [0] NOTE: -s and -n will be internally converted to bytes -v set verbose mode (0=data only, 1=stderr-report, 2=logfile) [0] EXAMPLES: xe-readbinary3 data.txt -h 500 -s 0 -n 1000 cat temp.txt | xe-readbinary3 stdin OUTPUT: ASCII numbers representing the data ----------------------------------------------------------------------
---------------------------------------------------------------------- xe-readscore1 v 9: 22.February.2016 [JRH] ---------------------------------------------------------------------- Read a SCORE raw file and output as ASCII or binary stream Input assumed to be unsigned 8bit ints (1 byte characters) Non-numeric values will be recoded "NaN" USAGE: xe-readscore1 [input] [options] [input]: SCORE raw-file name or "stdin" NOTE: data assumed to be "unsigned char" (8-bit int) VALID OPTIONS: -sf: sampling frequency (Hz) [400] -dur: duration (s) of each record [10] -head: size of record headers (bytes) [35] -start: record or time to start output at [0] two modes: record-number (integer >= zero) or time time must be in the format YY:MM:DD:hh:mm:ss NOTE: corrects for SCORE's use of MM:DD:YY format NOTE: if exact start-time is not found, there will be no output -n: max records to output (0 = all) [0] -lf: file listing record-numbers (0-offset) to output [unset] -out: output format (0=headers only, 1=ASCII, 2=binary) [1] 0=headers only 1=ASCII 2=binary (unsigned 8-bit integer = unsigned char) EXAMPLES: xe-readscore1 data30686.hpc4 -start 6 -n 1 -out 2 > output.bin OUTPUT: - all output is sent to stdout - if -out 0, header for each record + %clipping - if -out 1, simple ASCII (1-column) data stream - if -out 2, binary (unsigned char, = 8bit int) data stream ----------------------------------------------------------------------