The IgorR package for R provides routines to read binary files generated by Igor Pro.
-This includes both the standalone .ibw Igor Binary Wave format (v2 and the latest v5) and the .pxp Packed Experiment Format including both waves and variables. In addition the package provides functions to read files generated by the Neuromatic analysis suite written by Jason Rothman for Igor Pro.
-To install the latest development version from github
-# install hadley's devtools if required -if(!require('devtools')) install.packages('devtools') -devtools::install_github('jefferis/IgorR')
To checkout a version that can be used for development (RStudio is strongly recommended), in your terminal application.
- -In R
- -Details of the ibw file format were derived from the Igor Technical Note 003.
-For those interested in the source code, ReadIgorBinary.R provides code for standard pxp and ibw files, while ReadNclamp.R provides routines to read packed experiment files generated by the Nclamp data acquisition package.
-IgorR-package.Rd
This package provides function to read data from the Igor Pro data analysis
-program by Wavemetrics. The data formats supported are Igor packed experiment
-format (.pxp
) and Igor binary wave (.ibw
). See:
-http://www.wavemetrics.com/ for details.
It also includes some functions to load special pxp files produced by the -Neuromatic/Nclamp packages for recording and analysing neuronal #data. See -http://www.neuromatic.thinkrandom.com/ for details.
- - -IgorR-private.Rd
Private functions in IgorR Package
-Read the a short record header from the current location in a PXP file
-Note that the recordType will be one of the constants from Igor's -enum PackedFileRecordType
-.ReadPackedHeader(con, endian)- -
con | -an R connection to the file we are reading |
-
---|---|
endian | -either little or big |
-
a list containing information about the current record
- -ReadAllNclampLogTables.Rd
Read all Nclamp log tables from a directory into a list
-ReadAllNclampLogTables(logfiledir, pattern = "_log[0-9]+[.]pxp$", ...)- -
logfiledir | -path to directory containing log files (pxp files). |
-
---|---|
pattern | -optional regular expression -- see |
-
... | -additional parameters for |
-
A named list containing one dataframe for each parsed log file.
- --if (FALSE) { -logfiles <- ReadAllNclampLogTables("/GD/projects/PhysiologyData/logs") -str(logfiles) -}
ReadNclampLogTable.Rd
log tables are special Igor .pxp files that contain only variables. -Each entry corresponds to a single run of an Nclamp protocol, -storing information like protocol name, run time etc.
-ReadNclampLogTable(f, Verbose = FALSE)- -
f | -path to the log file. |
-
---|---|
Verbose | -whether to print status information while reading the file. |
-
A dataframe containing a row for each acquisition protocol run.
- -SummariseSweepFile.Rd
e.g. for import into Physiology database
-SummariseSweepFile(f, Verbose = FALSE)- -
f | -path to an Nclamp/Igor PXP format sweep file. |
-
---|---|
Verbose | -if |
-
A list of about 25 fields summarising the sweep file.
- --l <- SummariseSweepFile(system.file("igor", "WedJul407c2_001.pxp", package="IgorR")) -cat("There are", l$NumWaves, "waves in the file each of total duration", l$StimWaveLength, - "ms and sample duration", l$StimSampleInterval, "ms \n")#> There are 100 waves in the file each of total duration 20 ms and sample duration 0.025 ms
SweepFilesToDataFrame.Rd
Note that this is still a little fragile if the lists produced by
-SummariseSweepFile
do not have consistent field names.
SweepFilesToDataFrame(ff)- -
ff | -paths to a set of sweep files. |
-
---|
A dataframe with rows for each sweep file.
-SummariseSweepFile
UpdateSweepDataFrame.Rd
Update the CSV file summarising the sweeps in an Nclamp data folder
-UpdateSweepDataFrame( - folder, - outfile = NULL, - action = c("update", "force"), - DryRun = FALSE -)- -
folder | -path to the folder. |
-
---|---|
outfile | -path to outfile (default: |
-
action | -update newer (default) or force update (not yet implemented). |
-
DryRun | -if |
-
TRUE
if something happened, FALSE
otherwise.
WaveToTimeSeries.Rd
Where there are multiple waves, they are assumed to be of compatible lengths
-so that they can be joined together by cbind
.
WaveToTimeSeries(WaveData, ReturnOriginalDataOnError = TRUE)- -
WaveData, | -a wave or list of waves |
-
---|---|
ReturnOriginalDataOnError | -If we can't make a time series, return -return original data (default TRUE) |
-
a time series or multi time series (ts
,
- mts
)
read.ibw.Rd
Read binary files in the Igor Binary Wave format (IBW)
-read.ibw( - wavefile, - Verbose = FALSE, - ReturnTimeSeries = FALSE, - MakeWave = FALSE, - HeaderOnly = FALSE -)- -
wavefile | -either a character vector containing the path to a file or an -R connection. |
-
---|---|
Verbose | -if |
-
ReturnTimeSeries | -if |
-
MakeWave | -if |
-
HeaderOnly | -if |
-
A vector containing the wave data or, if MakeWave == TRUE
,
- returns the name of a new R vector containing the data which has been made
- in the user environment
Other igor-io:
-WaveToTimeSeries()
,
-read.pxp()
-# return a list containing the wave -wavedata=read.ibw(system.file("igor","version5.ibw",package="IgorR")) -sum(wavedata)#> [1] 15-# make a list containing the wave's data in the users's environment -wavename=read.ibw(system.file("igor","version5.ibw",package="IgorR"),MakeWave=TRUE) -sum(get(wavename))#> [1] 15
read.pxp.Rd
Note that PXP files are only partially documented so some contents cannot be -parsed (e.g. image data). This function currently reads data records (Igor -waves and variables), history, procedures, recreation macros and plain text -notebooks. Formatted notebooks cannot be read.
-read.pxp( - pxpfile, - regex, - ReturnTimeSeries = FALSE, - Verbose = FALSE, - StructureOnly = FALSE, - ExtractText = FALSE, - IgorPlatform = NULL, - ... -)- -
pxpfile | -character vector naming a PXP file or an R connection. |
-
---|---|
regex | -if |
-
ReturnTimeSeries | -if |
-
Verbose | -whether to print information to console during loading -(numeric values are also allowed 0=none, 1=basic, 2=all). |
-
StructureOnly | -(TODO) if |
-
ExtractText | -whether to extract procedures, recreation macros, history
-and plain text notebooks ( |
-
IgorPlatform | -OS on which Igor file was saved (windows or macintosh). |
-
... | -optional parameters passed to read.ibw. |
-
A list containing all the individual waves or variables in the PXP - file.
-IgorPlatform
will determine in which encoding text is read
-(WINDOWS-1252 for windows and macintosh for macintosh). Unique abbreviations
-are acceptable. Defaults to "windows"
on Windows, "macintosh"
-otherwise. Note that Igor Pro 5.5 added a PlatformRecord to the PXP file
-format which is used to determine the file's platform of origin when
-available. Since this is information straight from the horse's mouth it will
-override the IgorPlatform
argument.
Other igor-io:
-WaveToTimeSeries()
,
-read.ibw()
-
tsp.igorwave.Rd
Note that end = (npts-1) * deltat
-tsp.igorwave(wave)- -
wave | -Igor wave loaded by |
-
---|
numeric vector with elements start, end, frequency
-