AddMetaData {rnaEditr} | R Documentation

## Add metadata columns to GRanges object.

### Description

Add metadata information to GRanges object.

### Usage

    AddMetaData(
      target_gr,
      annot_gr = NULL,
      annotType_char = c("geneSymbol", "region"),
      annotLabel_char = "symbol",
      genome = c("hg38", "hg19")
    )

### Arguments

`target_gr` | A GRanges object that will be annotated with metadata
`annot_gr` | A GRanges object that includes the metadata information. When `annotType_char` = `"geneSymbol"`, this argument can be left as NULL, and the gene annotation file saved in the package will be used to annotate `target_gr`. When `annotType_char` = `"region"`, this argument must be specified, each row in `target_gr` will be annotated with rows in `annot_gr` that overlap with it.
`annotType_char` | Type of the metadata column, defaults to `"geneSymbol"`.
`annotLabel_char` | Name of the metadata column, defaults to `"symbol"` which corresponds to default setting `"geneSymbol"` for argument `annotType_char`.
`genome` | Use `"hg19"` or `"hg38"` gene reference. Defaults to `"hg38"`.

### Value

A GRanges object with `seqnames, ranges, region`, and supplied metadata information.

### Examples

      data(rnaedit_df)

      input_gr <- TransformToGR(
        genes_char = "PHACTR4",
        type = "symbol",
        genome = "hg19"
      )

      # identifies co-edited region within input_gr
      coedited_gr <- AllCoeditedRegions(
        regions_gr = input_gr,
        rnaEditMatrix = rnaedit_df,
        output = "GRanges",
        method = "spearman"
      )

      # identify input regions for co-edited regions
      AddMetaData(
        target_gr = coedited_gr,
        annot_gr = input_gr,
        annotType_char = "region",
        annotLabel_char = "inputRegion",
        genome = "hg19"
      )

[Package rnaEditr version 1.2.0 Index]