
Create a BetaHandler object for efficient beta value access
Source:R/beta_handler.R
getBetaHandler.RdCreate a new BetaHandler object that manages methylation beta values from various input formats (files, matrices, tabix, BSseq objects) with memory-efficient access patterns.
Arguments
- beta
Path to beta values file, or a tabix, or a beta matrix, or a BSseq object
- array
Array platform type, ignored if sorted_locs or a BSseq object have been provided
- genome
Reference genome version, eg. hg38 or hs1. Only human and mouse genomes are supported. Ignored if sorted_locs or a BSseq object have been provided.
- beta_row_names_file
Path to row names file
- sorted_locs
Data frame with genomic locations containing 'chr' and 'start' and 'end' columns, sorted by genomic position. If NULL, will be retrieved automatically using genome and array information, or extracted from BSseq object.
- chrom_col
Chromosome column name in tabix file
- start_col
Start position column name in tabix file
- output_prefix
Prefix used for saving derived beta artifacts.
- njobs
Number of parallel jobs to use when reading beta file or tabix file. Default is number of available cores minus one, up to a maximum of 8.
Examples
loadExampleInputData("beta")
beta_matrix <- beta
beta_handler <- getBetaHandler(
beta = beta_matrix,
array = "450K",
genome = "hg38"
)
beta_locs <- beta_handler$getBetaLocs()
head(beta_locs)
beta_values <- beta_handler$getBeta()
head(beta_values[, 1:5])