Learn R Programming

RnBeads (version 1.4.0)

read.idat.files2: read.idat.files2

Description

Reads a directory of .idat files and initializes an object of type MethyLumiSet.

Usage

read.idat.files2(base.dir, barcodes = NULL, sample.sheet = NULL, sep.samples = rnb.getOption("import.table.separator"), load.chunk = NULL, keep.methylumi = FALSE, verbose = TRUE)

Arguments

base.dir
Directory that contains the .idat files to be read; or a character vector of such directories.
barcodes
Optional non-empty character vector listing the barcodes of the samples that should be loaded. 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.
sep.samples
character used as field separator in the sample sheet file. Default value is taken by the call to rnb.getOption("import.table.separator")
load.chunk
integer of size one, giving the number of IDAT files which should be loaded in one loading cycle or NULL, in which case an attempt will be made to load all files in one go. Should be assigned in case the number of IDATs is more than one thousand.
keep.methylumi
a flag indicating whether the a MethyLumiSet object should be returned instead of a RnBeadRawSet.
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.

Value

Loaded dataset of HumanMethylation450K samples, encapsulated in an object of type MethyLumiSet.

Details

If neither barcodes, nor sample.sheet are specified, the function attempts to locate a file in base.dir containing sample annotation information. It fails ifsuch a file cannot be (unambiguously) identified. If both barcodes and sample.sheet are supplied, only sample.sheet is used in loading methylation data. The value of barcodes is tested for validity but it is not used as a filter.

See Also

methylumIDAT in package methylumi