Title: | Read Binary Files Saved by 'Igor Pro' (Including 'Neuromatic' Data) |
---|---|
Description: | 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: <https://www.wavemetrics.com/> for details. Also includes functions to load special 'pxp' files produced by the 'Igor Pro' 'Neuromatic' and 'Nclamp' packages for recording and analysing neuronal data. See <https://github.com/SilverLabUCL/NeuroMatic> for details. |
Authors: | Gregory Jefferis [aut, cre] , Thomas Braun [ctb] |
Maintainer: | Gregory Jefferis <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.9.0 |
Built: | 2024-10-28 04:50:12 UTC |
Source: | https://github.com/jefferis/igorr |
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:
https://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 https://github.com/SilverLabUCL/NeuroMatic for details.
Key functions in the package include read.ibw
,
read.pxp
.
Maintainer: Gregory Jefferis [email protected] (ORCID)
Other contributors:
Thomas Braun [contributor]
Useful links:
Report bugs at https://github.com/jefferis/IgorR/issues
.ReadPackedHeader
reads the short record header from the
current location in a PXP file
.ReadPackedHeader(con, endian)
.ReadPackedHeader(con, endian)
con |
an R connection to the file we are reading |
endian |
either little or big |
Note that the recordType
will be one of the constants from
Igor's enum PackedFileRecordType
a list containing information about the current record
jefferis
Read binary files in the Igor Binary Wave format (IBW)
read.ibw( wavefile, Verbose = FALSE, ReturnTimeSeries = FALSE, MakeWave = FALSE, HeaderOnly = FALSE )
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
jefferis
Other igor-io:
WaveToTimeSeries()
,
read.pxp()
# return a list containing the wave wavedata=read.ibw(system.file("igor","version5.ibw",package="IgorR")) sum(wavedata) # 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))
# return a list containing the wave wavedata=read.ibw(system.file("igor","version5.ibw",package="IgorR")) sum(wavedata) # 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))
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, ... )
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. |
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.
A list containing all the individual waves or variables in the PXP file.
jefferis
Other igor-io:
WaveToTimeSeries()
,
read.ibw()
r=read.pxp(system.file("igor","testexpt.pxp",package="IgorR"))
r=read.pxp(system.file("igor","testexpt.pxp",package="IgorR"))
Read all Nclamp log tables from a directory into a list
ReadAllNclampLogTables(logfiledir, pattern = "_log[0-9]+[.]pxp$", ...)
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.
jefferis
## Not run: logfiles <- ReadAllNclampLogTables("/GD/projects/PhysiologyData/logs") str(logfiles) ## End(Not run)
## Not run: logfiles <- ReadAllNclampLogTables("/GD/projects/PhysiologyData/logs") str(logfiles) ## End(Not run)
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)
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.
jefferis
e.g. for import into Physiology database
SummariseSweepFile(f, Verbose = FALSE)
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.
jefferis
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")
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")
Note that this is still a little fragile if the lists produced by
SummariseSweepFile
do not have consistent field names.
SweepFilesToDataFrame(ff)
SweepFilesToDataFrame(ff)
ff |
paths to a set of sweep files. |
A dataframe with rows for each sweep file.
jefferis
SummariseSweepFile
Note that end = (npts-1) * deltat
tsp.igorwave(wave)
tsp.igorwave(wave)
wave |
Igor wave loaded by |
numeric vector with elements start, end, frequency
jefferis
Update the CSV file summarising the sweeps in an Nclamp data folder
UpdateSweepDataFrame( folder, outfile = NULL, action = c("update", "force"), DryRun = FALSE )
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.
jefferis
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)
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
)
jefferis
Other igor-io:
read.ibw()
,
read.pxp()