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

1
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

1
2
3
getGenomeAndMask("hg19", mask=NA)

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.