ranges-info {plyranges} | R Documentation

## Construct annotation information

### Description

To construct annotations by supplying annotation information use `genome_info`. This function allows you to get UCSC build information via `GenomeInfoDb::fetchExtendedChromInfoFromUCSC()`. To add annotations to an existing Ranges object use `set_genome_info`. To retrieve an annotation as a Ranges object use `get_genome_info`.

### Usage

    genome_info(
      genome = NULL,
      seqnames = NULL,
      seqlengths = NULL,
      is_circular = NULL
    )

    set_genome_info(
      .data,
      genome = NULL,
      seqnames = NULL,
      seqlengths = NULL,
      is_circular = NULL
    )

    get_genome_info(.data)

### Arguments

`genome` | A character vector of length one indicating the genome build. If this is the only argument supplied, the build information will be retrieved from UCSC database.
`seqnames` | A character vector containing the name of sequences.
`seqlengths` | An optional integer vector containg the lengths of sequences.
`is_circular` | An optional logical vector indicating whether a sequence is ciruclar.
`.data` | A Ranges object to annotate or retrieve an annotation for.

### Value

a GRanges object containing annotations. To retrieve the annotations as a Ranges object use `get_genome_info`.

### See Also

`GenomeInfoDb::Seqinfo()`, `GenomeInfoDb::fetchExtendedChromInfoFromUCSC()`

### Examples

    x <- genome_info(genome = "toy",
                     seqnames = letters[1:4],
                     seqlengths = c(100, 300, 15, 600),
                     is_circular = c(NA, FALSE, FALSE, TRUE))
    x

    rng <- as_granges(data.frame(seqnames = "a", start = 30:50, width = 10))
    rng
    rng <- set_genome_info(rng,
                           genome = "toy",
                           seqnames = letters[1:4],
                           seqlengths = c(100, 300, 15, 600),
                           is_circular = c(NA, FALSE, FALSE, TRUE))
    get_genome_info(rng)

    ## Not run:
    if (interactive()) {
     # requires internet connection
     genome_info(genome = "hg38")
    }

    ## End(Not run)

[Package plyranges version 1.14.0 Index]