bed-class: Class bed

bed-classR Documentation

Class bed

Description

A reference class for storing a pointer to a mapped version of a bed file.

Usage

bed(bedfile)

Arguments

bedfile

Path to file with extension ".bed" to read. You need the corresponding ".bim" and ".fam" in the same directory.

Details

A bed object has many field:

  • ⁠$address⁠: address of the external pointer containing the underlying C++ object, to be used internally as a ⁠XPtr<bed>⁠ in C++ code

  • ⁠$extptr⁠: use ⁠$address⁠ instead

  • ⁠$bedfile⁠: path to the bed file

  • ⁠$bimfile⁠: path to the corresponding bim file

  • ⁠$famfile⁠: path to the corresponding fam file

  • ⁠$prefix⁠: path without extension

  • ⁠$nrow⁠: number of samples in the bed file

  • ⁠$ncol⁠: number of variants in the bed file

  • ⁠$map⁠: data frame read from ⁠$bimfile⁠

  • ⁠$fam⁠: data frame read from ⁠$famfile⁠

  • ⁠$.map⁠: use ⁠$map⁠ instead

  • ⁠$.fam⁠: use ⁠$fam⁠ instead

  • ⁠$light⁠: get a lighter version of this object for parallel algorithms to not have to transfer e.g. ⁠$.map⁠.

Examples

bedfile <- system.file("extdata", "example-missing.bed", package = "bigsnpr")
(obj.bed <- bed(bedfile))


bigsnpr documentation built on March 31, 2023, 10:37 p.m.