getGenomeAndMask: getGenomeAndMask

getGenomeAndMaskR Documentation

getGenomeAndMask

Description

Function to obtain a valid genome and mask pair given a valid genome identifier and optionally a mask.

If the genome is not a BSgenome object or a character string uniquely identifying a BSgenome package installed, it will return the genome "as is". If a mask is provided, it will simply return it. Otherwise it will return the mask returned by getMask(genome) or an empty mask if genome is not a valid BSgenome or BSgenome identifier.

Usage

getGenomeAndMask(genome, mask=NULL)

Arguments

genome

the genome object or genome identifier.

mask

the mask of the genome in a valid RS format (data.frame, GRanges, BED-like file...). If mask is NULL, it will try to get a mask from the genome. If mask is NA it will return an empty mask. (Default=NULL)

Value

A list with two elements: genome and mask. Genome and mask are GRanges objects.

Note

This function is memoised (cached) using the memoise package. To empty the cache, use forget(getGenomeAndMask)

See Also

getMask, getGenome, characterToBSGenome, maskFromBSGenome, emptyCacheRegioneR

Examples

getGenomeAndMask("hg19", mask=NA)

getGenomeAndMask(genome=data.frame(c("chrA", "chrB"), c(15000000, 10000000)), mask=NA)


bernatgel/regioneR documentation built on Sept. 10, 2023, 12:03 a.m.