Description Usage Arguments Details Value Note See Also Examples
Function to obtain a genome
1 | getGenome(genome)
|
genome |
The genome object or genome identifier. |
If genome is a BSgenome
(from the package BioStrings
), it will transform it into a GRanges
with chromosomes and chromosome lengths.
If genome is a data.frame
with 3 columns, it will transform it into a GRanges.
If genome is a data.frame
with 2 columns, it will assume the first is the chromosome, the second is the length of the chromosomes and will add 1 as start.
If genome is a character
string uniquely identifying a BSgenome
installed in the system (e.g. "hg19", "mm10",... but not "hg"), it will create a genome based on the BSgenome
object identified by the character string.
If genome is a GRanges
object, it will return it as is.
If genome is non of the above, it will give a warning and try to transform it into a GRanges using toGRanges. This can be helpful if genome
is a connection to a file.
A GRanges object with the "genome" data c(Chromosome, Start (by default, 1), Chromosome Length) given a BSgenome
, a genome name, a data.frame
or a GRanges.
A GRanges
representing the genome with one region per chromosome.
This function is memoised (cached) using the memoise
package. To empty the cache, use forget(getGenome)
Please note that passing this function the path to a file will not work, since it will assume the character is the identifier of a genome. To read the genome
from a file, please use getGenome(toGRanges("path/to/file"))
getMask
, getGenomeAndMask
, characterToBSGenome
, maskFromBSGenome
, emptyCacheRegioneR
1 2 3 4 | getGenome("hg19")
getGenome(data.frame(c("chrA", "chrB"), c(15000000, 10000000)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.