Buxco file Parsers {plethy} | R Documentation

## Functions for parsing Buxco respirometry data

### Description

A typical Buxco respirometry experiment involves collecting repeated measures on both acclimation and experimental data related to metabolism and respiration. The `parse.buxco` function creates a local database representation of a given file to facilitate fast retrieval and ultimately analysis. The user should only use `parse.buxco` with `parse.buxco.basic` mainly used for testing purposes.

### Usage

    parse.buxco(file.name = NULL, table.delim = "Table", burn.in.lines = c("Measurement", "Create measurement", "Waiting for", "Site Acknowledgement Changed"),
      chunk.size = 500, db.name = "bux_test.db", max.run.time.minutes = 60, overwrite = TRUE, verbose=TRUE, make.package = F, author = NULL, author.email = NULL)
    parse.buxco.basic(file.name=NULL, table.delim="Table", burn.in.lines=c("Measurement", "Create measurement", "Waiting for", "Site Acknowledgement Changed"))

### Arguments

`file.name` | A path to the Buxco CSV file. See vignette for further description of the required file format.
`table.delim` | A character vector of length one containing the pattern used to divide the Buxco file into tables.
`burn.in.lines` | A character vector containing the patterns used to divided each Buxco table into readings for different animals.
`chunk.size` | The number of lines that should be read in at a given time, more lines results in more memory consumption and quicker parsing speed.
`db.name` | The file name of the local database to create.
`max.run.time.minutes` | The maximum time in minutes that a acclimation or experimental run should take. A warning will be given if this is exceeded and the data will be treated as if there were seperate runs.
`overwrite` | A logical value specifying whether the local database specified in `db.name` should be overwritten if exists.
`verbose` | A logical value specifying if additional information should be printed as parsing progresses.
`make.package` | A logical value indicating whether a package should be created in db.name instead of a database file.
`author` | If make.package == T, a string value indicating who the package author should be.
`author.email` | If make.package == T, a string value indicating what the package author's email address should be.

### Details

The `parse.buxco` function reads in the specified file in chunks. It uses the lines specified in `burn.in.lines` to determine whether a 'break' has been reached. Each break signifies that a series of readings for several animals has been completed and so only upon reaching a break is measurement data written to the database for the completed measurement sets. Because of this, there will always be some memory overhead in proportion to the number of readings in each series irrespective of `chunk.size`. To access the database in R, use the convienience method `retrieveData`.

### Value

The `parse.buxco` function returns a `BuxcoDB` object. The `parse.buxco.basic` function returns a `data.frame`.

### Note

`parse.buxco.basic` should not be used directly as it is extremely memory intensive as it parses the entire file at once and returns a `data.frame` result.

### Author(s)

Daniel Bottomly

### References

http://www.buxco.com/

### See Also

`BuxcoDB`, `retrieveData`

### Examples

    bux.db <- parse.buxco(file.name=buxco.sample.data.path(), db.name =tempfile())

    head(retrieveData(bux.db))

[Package plethy version 1.26.0 Index]