extendedMapSeqlevels {derfinder} | R Documentation

## 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. To disable this functionality specify set `chrsStyle` to `NULL`.

### 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. Advanced arguments: verbose If `TRUE` basic status updates will be printed along the way. chrsStyle The naming style of the chromosomes. By default, `UCSC`. See seqlevelsStyle. Set to `NULL` to disable this function. This is used when `style` is missing, which is normally the case when `extendedMapSeqlevels` is called by other functions.

### 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.

If you want to disable this function, set `chrsStyle` to `NULL`. From other functions in derfinder that pass the `...` argument to this function, use `chrsStyle = NULL`. This can be useful when working with organisms that are absent from GenomeInfoDb as documented in https://support.bioconductor.org/p/95521/.

### Value

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

### Author(s)

L. Collado-Torres

### Examples

    ## 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")

    ## Disable extendedMapSeqlevels. This can be useful when working with
    ## organisms that are not supported by GenomeInfoDb
    chrs <- c(
        "I", "II", "III", "IV", "IX", "V", "VI", "VII", "VIII", "X",
        "XI", "XII", "XIII", "XIV", "XV", "XVI", "XVII"
    )
    extendedMapSeqlevels(chrs, chrsStyle = NULL)
    ## Not run:
    ## Set global species and style option
    options("chrsStyle" = "UCSC")
    options("species" = "homo_sapiens")

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

    ## End(Not run)

[Package derfinder version 1.26.0 Index]