AnnotateResults: Add Annotations to site-specific or region-based analysis...

Description Usage Arguments Value See Also Examples

View source: R/AnnotateResults.R

Description

Add annotations to site-specific or region-based analysis results from function TestAssociations.

Usage

1
2
3
4
5
6
7
AnnotateResults(
  results_df,
  closeByRegions_gr = NULL,
  inputRegions_gr = NULL,
  genome = c("hg38", "hg19"),
  analysis = c("region-based", "site-specific")
)

Arguments

results_df

An output data frame from function TestAssociations, which includes variables for locations and result of statistical tests for the genomic sites or regions.

closeByRegions_gr

An output GRanges object from function AllCloseByRegions, defaults to NULL.

inputRegions_gr

A GRanges object for input genomic regions, defaults to NULL.

genome

Use "hg19" or "hg38" gene reference. Defaults to "hg38".

analysis

Results type. Defaults to "region-based". When it's set to "site-specific", arguments closeByRegions_gr and inputRegions_gr will not be used and set to NULL automatically.

Value

A data frame with locations of the genomic sites or regions (seqnames, start, end, width), annotations for locations (inputRegion, closeByRegion, symbol), test statistics (estimate, stdErr or coef, exp_coef, se_coef), pValue and false discovery rate (fdr).

See Also

TransformToGR, AllCloseByRegions, AllCoeditedRegions, CreateEditingTable, SummarizeAllRegions, TestAssociations

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  data(rnaedit_df)
  
  # get GRanges for genes
  genes_gr <- TransformToGR(
    genes_char = c("PHACTR4", "CCR5", "METTL7A"),
    type = "symbol",
    genome = "hg19"
  )
  
  # find close-by regions within the genes
  closebyRegions_gr <- AllCloseByRegions(
    regions_gr = genes_gr,
    rnaEditMatrix = rnaedit_df
  )
  
  # identify co-edited regions within the genes 
  coedited_gr <- AllCoeditedRegions(
    regions_gr = closebyRegions_gr,
    rnaEditMatrix = rnaedit_df,
    output = "GRanges",
    method = "spearman"
  )
  
  # summarize editing levels within each gene by maximum
  summarizedRegions_df <- SummarizeAllRegions(
    regions_gr = coedited_gr,
    rnaEditMatrix = rnaedit_df,
    selectMethod = MaxSites
  )
  
  exm_pheno <- readRDS(
    system.file(
    "extdata",
    "pheno_df.RDS",
    package = 'rnaEditr',
    mustWork = TRUE
    )
  )
  
  # test summarized editing levels against survival outcome
  results_df <- TestAssociations(
    rnaEdit_df = summarizedRegions_df,
    pheno_df = exm_pheno,
    responses_char = "sample_type",
    covariates_char = NULL,
    respType = "binary"
  )
  
  AnnotateResults(
    results_df = results_df,
    closeByRegions_gr = closebyRegions_gr,
    inputRegions_gr = genes_gr,
    genome = "hg19"
  )
  

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