ranges-info: Construct annotation information

ranges-infoR Documentation

Construct annotation information

Description

To construct annotations by supplying annotation information use genome_info. 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.

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()

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)


sa-lee/plyranges documentation built on April 15, 2024, 12:25 p.m.