Type: | Package |
Title: | Read Binary Files Saved by 'Igor Pro' (Including 'Neuromatic' Data) |
Version: | 0.9.0 |
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. |
Imports: | bitops, tools, timechange |
Suggests: | spelling, testthat |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
LazyLoad: | yes |
RoxygenNote: | 7.3.2 |
Language: | en-GB |
Encoding: | UTF-8 |
URL: | https://github.com/jefferis/IgorR, https://jefferis.github.io/IgorR/ |
BugReports: | https://github.com/jefferis/IgorR/issues |
NeedsCompilation: | no |
Packaged: | 2024-08-23 09:30:04 UTC; jefferis |
Author: | Gregory Jefferis |
Maintainer: | Gregory Jefferis <jefferis@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-08-28 08:20:09 UTC |
Read binary files saved by Igor Pro (including Neuromatic data)
Description
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.
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
.
Author(s)
Maintainer: Gregory Jefferis jefferis@gmail.com (ORCID)
Other contributors:
Thomas Braun [contributor]
See Also
Useful links:
Report bugs at https://github.com/jefferis/IgorR/issues
Private functions in IgorR Package
Description
.ReadPackedHeader
reads the short record header from the
current location in a PXP file
Usage
.ReadPackedHeader(con, endian)
Arguments
con |
an R connection to the file we are reading |
endian |
either little or big |
Details
Note that the recordType
will be one of the constants from
Igor's enum PackedFileRecordType
Value
a list containing information about the current record
Author(s)
jefferis
Read all Nclamp log tables from a directory into a list
Description
Read all Nclamp log tables from a directory into a list
Usage
ReadAllNclampLogTables(logfiledir, pattern = "_log[0-9]+[.]pxp$", ...)
Arguments
logfiledir |
path to directory containing log files (pxp files). |
pattern |
optional regular expression – see |
... |
additional parameters for |
Value
A named list containing one dataframe for each parsed log file.
Author(s)
jefferis
Examples
## Not run:
logfiles <- ReadAllNclampLogTables("/GD/projects/PhysiologyData/logs")
str(logfiles)
## End(Not run)
Read the log table produced by Nclamp acquisition software for Igor
Description
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.
Usage
ReadNclampLogTable(f, Verbose = FALSE)
Arguments
f |
path to the log file. |
Verbose |
whether to print status information while reading the file. |
Value
A dataframe containing a row for each acquisition protocol run.
Author(s)
jefferis
Extract summary information from an Nclamp/Igor Sweep File
Description
e.g. for import into Physiology database
Usage
SummariseSweepFile(f, Verbose = FALSE)
Arguments
f |
path to an Nclamp/Igor PXP format sweep file. |
Verbose |
if |
Value
A list of about 25 fields summarising the sweep file.
Author(s)
jefferis
Examples
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")
Summarise multiple sweep files into a single dataframe
Description
Note that this is still a little fragile if the lists produced by
SummariseSweepFile
do not have consistent field names.
Usage
SweepFilesToDataFrame(ff)
Arguments
ff |
paths to a set of sweep files. |
Value
A dataframe with rows for each sweep file.
Author(s)
jefferis
See Also
SummariseSweepFile
Update the CSV file summarising the sweeps in an Nclamp data folder
Description
Update the CSV file summarising the sweeps in an Nclamp data folder
Usage
UpdateSweepDataFrame(
folder,
outfile = NULL,
action = c("update", "force"),
DryRun = FALSE
)
Arguments
folder |
path to the folder. |
outfile |
path to outfile (default: |
action |
update newer (default) or force update (not yet implemented). |
DryRun |
if |
Value
TRUE
if something happened, FALSE
otherwise.
Author(s)
jefferis
Convert an Igor wave (wave list) loaded by read.ibw into an R time series
Description
Where there are multiple waves, they are assumed to be of compatible lengths
so that they can be joined together by cbind
.
Usage
WaveToTimeSeries(WaveData, ReturnOriginalDataOnError = TRUE)
Arguments
WaveData |
a wave or list of waves |
ReturnOriginalDataOnError |
If we can't make a time series, return return original data (default TRUE) |
Value
a time series or multi time series (ts
,
mts
)
Author(s)
jefferis
See Also
Other igor-io:
read.ibw()
,
read.pxp()
Read binary files in the Igor Binary Wave format (IBW)
Description
Read binary files in the Igor Binary Wave format (IBW)
Usage
read.ibw(
wavefile,
Verbose = FALSE,
ReturnTimeSeries = FALSE,
MakeWave = FALSE,
HeaderOnly = FALSE
)
Arguments
wavefile |
either a character vector containing the path to a file or an R connection. |
Verbose |
if |
ReturnTimeSeries |
if |
MakeWave |
if |
HeaderOnly |
if |
Value
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
Author(s)
jefferis
See Also
Other igor-io:
WaveToTimeSeries()
,
read.pxp()
Examples
# 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))
Reads an Igor Pro Packed Experiment (.pxp) file
Description
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.
Usage
read.pxp(
pxpfile,
regex,
ReturnTimeSeries = FALSE,
Verbose = FALSE,
StructureOnly = FALSE,
ExtractText = FALSE,
IgorPlatform = NULL,
...
)
Arguments
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. |
Details
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.
Value
A list containing all the individual waves or variables in the PXP file.
Author(s)
jefferis
See Also
Other igor-io:
WaveToTimeSeries()
,
read.ibw()
Examples
r=read.pxp(system.file("igor","testexpt.pxp",package="IgorR"))
Return tsp attribute of Igor wave (start, end, frequency)
Description
Note that end = (npts-1) * deltat
Usage
tsp.igorwave(wave)
Arguments
wave |
Igor wave loaded by |
Value
numeric vector with elements start, end, frequency
Author(s)
jefferis