GRanges-converters {SomaticSignatures} | R Documentation

## GRanges converter functions

### Description

A set of utilities functions to convert and extract data in 'GRanges' objects.

### Usage

      ncbi(x)
      ucsc(x)
      seqchar(x)

### Arguments

`x` | A 'GRanges' object or one inheriting from the 'GRanges' class [required].

### Details

- grangesExtracts only the 'GRanges' information by dropping the metadata columns of the object. The 'seqinfo' slot is kept.

- ncbi, ucscShorthand for converting the seqnames notation to 'UCSC' (e.g. 'chr1', 'chrM') or 'NCBI' (e.g. '1', 'MT”) notation, respectively. This also sets the 'genome' slot in the 'seqinfo' field to 'NA'.

- seqcharExtracts the 'seqnames' as a character vector.

### Value

For 'ncbi', 'ucsc': An object of the same class as the input.

For 'seqchar': A character vector with 'seqnames'.

### See Also

`seqnames`, `mcols`

`seqlevelsStyle`

### Examples

      mutect_path = system.file("examples", "mutect.tsv", package = "SomaticSignatures")
      vr1 = readMutect(mutect_path, strip = TRUE)

      ## extract the GRanges
      gr = granges(vr1)

      ## convert back and forth
      gr_ncbi = ncbi(gr)
      gr_ucsc = ucsc(gr_ncbi)

      identical(gr, gr_ucsc)

      ## extract the seqnames as a character vector
      seq_chars = seqchar(gr)

[Package SomaticSignatures version 2.23.0 Index]