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




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


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.


bedfile <- system.file("extdata", "example-missing.bed", package = "bigsnpr")
(obj.bed <- bed(bedfile))
#> A 'bed' object with 200 samples and 500 variants.