Learn R Programming

derfinder (version 1.6.4)

extendedMapSeqlevels: Change naming style for a set of sequence names

Description

If available, use the information from GenomeInfoDb for your species of interest to map the sequence names from the style currently used to another valid style. For example, for Homo sapiens map '2' (NCBI style) to 'chr2' (UCSC style). If the information from GenomeInfoDb is not available, the original sequence names will be returned.

Usage

extendedMapSeqlevels(seqnames, style = getOption("chrsStyle", "UCSC"),
  species = getOption("species", "homo_sapiens"), currentStyle = NULL, ...)

Arguments

seqnames
A character vector with the sequence names.
style
A single character vector specifying the naming style to use for renaming the sequence names.
species
A single character vector with the species of interest: it has to match the valid species names supported in GenomeInfoDb. See names(GenomeInfoDb::genomeStyles()). If species = NULL, a guess will be made using the available information in GenomeInfoDb.
currentStyle
A single character vector with the currently used naming style. If NULL, a guess will be made from the naming styles supported by species.
...
Arguments passed to other methods and/or advanced arguments.

Value

  • A vector of sequence names using the specified naming style.

Details

This function is inspired from mapSeqlevels with the difference that it will return the original sequence names if the species, current naming style or target naming style are not supported in GenomeInfoDb.

Examples

Run this code
## Without guessing any information
extendedMapSeqlevels('2', 'UCSC', 'Homo sapiens', 'NCBI')

## Guessing the current naming style
extendedMapSeqlevels('2', 'UCSC', 'Homo sapiens')

## Guess species and current style
extendedMapSeqlevels('2', 'NCBI')

## Guess species while supplying the current style.
## Probably an uncommon use-case
extendedMapSeqlevels('2', 'NCBI', currentStyle = 'TAIR10')

## Sequence names are unchanged when using an unsupported species
extendedMapSeqlevels('seq2', 'NCBI', 'toyOrganism')

## Set global species and style option
options('chrsStyle' = 'UCSC')
options('species' = 'homo_sapiens')

## Run using global options
extendedMapSeqlevels('2')

Run the code above in your browser using DataLab