AddMetaData: Add metadata columns to GRanges object.

Description Usage Arguments Value Examples

View source: R/util_AddMetaData.R

Description

Add metadata information to GRanges object.

Usage

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  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"
  )
  

rnaEditr documentation built on Nov. 8, 2020, 8:26 p.m.