AllCoeditedRegions: Extracts contiguous co-edited genomic regions from input...

View source: R/AllCoeditedRegions.R

AllCoeditedRegionsR Documentation

Extracts contiguous co-edited genomic regions from input genomic regions .

Description

A wrapper function to extract contiguous co-edited genomic regions from input genomic regions.

Usage

AllCoeditedRegions(
  regions_gr,
  rnaEditMatrix,
  output = c("GRanges", "dataframe"),
  rDropThresh_num = 0.4,
  minPairCorr = 0.1,
  minSites = 3,
  method = c("spearman", "pearson"),
  returnAllSites = FALSE,
  progressBar = "time",
  verbose = TRUE
)

Arguments

regions_gr

A GRanges object of input genomic regions.

rnaEditMatrix

A matrix (or data frame) of RNA editing level values on individual sites, with row names as site IDs in the form of "chrAA:XXXXXXXX", and column names as sample IDs. Please make sure to follow the format of example dataset (data(rnaedit_df)).

output

Type of output data. Defaults to "GRanges".

rDropThresh_num

Threshold for minimum correlation between RNA editing levels of one site and the mean RNA editing levels of the rest of the sites. Please set a number between 0 and 1. Defaults to 0.4.

minPairCorr

Threshold for minimum pairwise correlation of sites within a selected cluster. To use this filter, set a number between -1 and 1 (defaults to 0.1). To select all clusters (i.e. no filter), please set this argument to -1.

minSites

Minimum number of sites to be considered as a region. Only regions with more than minSites number of sites will be returned.

method

Method for computing correlation. Defaults to "spearman".

returnAllSites

When no contiguous co-edited regions are found in an input genomic region, returnAllSites = TRUE indicates returning all the sites in the input region, while returnAllSites = FALSE indicates not returning any site from input region. Defaults to FALSE.

progressBar

Name of the progress bar to use. There are currently five types of progress bars: "time", "none", "text", "tk", and "win". Defaults to "time". See create_progress_bar for more details.

verbose

Should messages and warnings be displayed? Defaults to FALSE, but is set to TRUE when called from within SingleCoeditedRegion().

Value

When output is set as "GRanges", a GRanges object with seqnames, ranges and strand of the contiguous co-edited regions will be returned. When output is set as "dataframe", a data frame with following columns will be returned:

  • site : site ID.

  • chr : chromosome number.

  • pos : genomic position number.

  • r_drop : the correlation between RNA editing levels of one site and the mean RNA editing levels of the rest of the sites.

  • keep : indicator for co-edited sites, the sites with keep = 1 belong to the contiguous and co-edited region.

  • keep_contiguous : contiguous co-edited region number.

  • regionMinPairwiseCor : the pairwise correlation of a subregion.

  • keep_regionMinPairwiseCor : indicator for contiguous co-edited subregions, the regions with keepminPairwiseCor = 1 passed the minimum correlation and will be returned as a contiguous co-edited subregion.

See Also

TransformToGR, AllCloseByRegions, CreateEditingTable, SummarizeAllRegions, TestAssociations, AnnotateResults

Examples

  data(rnaedit_df)
  
  genes_gr <- TransformToGR(
    genes_char = c("PHACTR4", "CCR5", "METTL7A"),
    type = "symbol",
    genome = "hg19"
  )
  
  AllCoeditedRegions(
    regions_gr = genes_gr,
    rnaEditMatrix = rnaedit_df,
    output = "GRanges",
    method = "spearman"
  )
   

TransBioInfoLab/rnaEditr documentation built on Nov. 29, 2022, 3:31 p.m.