read.bed.files {RnBeads} | R Documentation

## read.bed.files

### Description

Reads a reduced-representation/whole-genome bisulfite sequencing data set from a set of BED files

### Usage

    read.bed.files(base.dir = NULL, file.names = NULL,
      sample.sheet = NULL, file.names.col = 0,
      assembly = rnb.getOption("assembly"),
      region.types = rnb.region.types.for.analysis(assembly),
      pos.coord.shift = 1L, skip.lines = 1,
      sep.samples = rnb.getOption("import.table.separator"),
      merge.bed.files = TRUE,
      useff = rnb.getOption("disk.dump.big.matrices"),
      usebigff = rnb.getOption("disk.dump.bigff"), verbose = TRUE, ...)

### Arguments

`base.dir` | Directory with BED files contatining processed methylation data
`file.names` | Optional non-empty `character` vector listing the names of the files that should be loaded relative to `base.dir`. If supplied, this vector must not contain `NA` among its elements.
`sample.sheet` | Optional file name containing a table of sample annotation data, or the table itself in the form of a `data.frame` or `matrix`. Only (and all) samples defined in this table will be loaded. The table is expected to contain a column named `"barcode"` that lists the samples' Sentrix barcodes. If such a column is not present, this function searches for columns `"Sentrix_ID"` and `"Sentrix_Position"` (or similar) that build a barcode.
`file.names.col` | Column of the sample sheet which contains the file names (integer singleton). If `NA` an attempt will be made to find a suiting column automatically.
`assembly` | Genome assembly. Defaults to human (`"hg19"`)
`region.types` | `character` vector storing the types of regions for which the methylation information is to be summarized. The function `rnb.region.types` provides the list of all supported regions. Setting this to `NULL` or an empty vector restricts the dataset to site methylation only.
`pos.coord.shift` | The frame shift between the the CpG annotation (1-based) and the coordinates in the loaded BEDs. If BEDs have 0-based coordinates, `pos.coord.shift=1` (default).
`skip.lines` | The number of top lines to skip while reading the BED files
`sep.samples` | `character` singleton used as field separator in the sample sheet file. Default value is taken by the call to `rnb.getOption("import.table.separator")`
`merge.bed.files` | In case multiple BED files are specified for each sample, the flag indicates whether the methylation calls should be merged after reading
`useff` | If `TRUE`, functionality provided by the `ff` package will be used to read the data efficiently.
`usebigff` | flag specifying whether the extended ff functionality should be used (large matrix support for ff)
`verbose` | Flag indicating ifthe messages to the logger should be sent. Note that the logger must be initialized prior to calling this function. Logging is useful for keeping a record of the downloaded and processed samples. Also, informative messages are stored in case of an error.
`...` | Further arguments which are passed to the internal function `read.single.bed` and to `read.table`

### Details

To control the BED column assignment, one should also supply arguments to `read.single.bed`.

### Value

an object of class `RnBiseqSet`

### Author(s)

Pavlo Lutsik

[Package RnBeads version 2.2.0 Index]