SitesToRegion: Create output data in the format of GRanges.

View source: R/util_SitesToRegion.R

SitesToRegionR Documentation

Create output data in the format of GRanges.

Description

Output contiguous co-edited subregions found by FindCorrelatedRegions function and filtered by GetMinPairwiseCor function.

Usage

SitesToRegion(
  sitesSubregion_df,
  sitesAreOrdered = TRUE,
  keepminPairwiseCor_df,
  returnAllSites = FALSE,
  verbose = TRUE
)

Arguments

sitesSubregion_df

An output data frame from function FindCorrelatedRegions with variables site, subregion. Please see FindCorrelatedRegions for details.

sitesAreOrdered

Are the sites in sitesSubregion_df ordered by location? Defaults to FALSE.

keepminPairwiseCor_df

An output data frame from function GetMinPairwiseCor with variables subregion, keepminPairwiseCor and minPairwiseCor. Please see GetMinPairwiseCor for details.

returnAllSites

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

verbose

Should messages and warnings be displayed? Defaults to TRUE.

Value

A GRanges object with seqnames, ranges and strand of the contiguous co-edited regions.

Examples

  data(t_rnaedit_df)
  
  ordered_cols <- OrderSitesByLocation(
    sites_char = colnames(t_rnaedit_df),
    output = "vector"
  )
  exm_data <- t_rnaedit_df[, ordered_cols]
  
  exm_sites <- MarkCoeditedSites(
    rnaEditCluster_mat = exm_data,
    method = "spearman"
  )
  
  exm_regions <- FindCorrelatedRegions(
    sites_df = exm_sites,
    featureType = "site"
  )
  
  exm_sites <- split(
    x = exm_regions$site,
    f = exm_regions$subregion
  )
  
  exm_cor <- GetMinPairwiseCor(
    rnaEditCluster_mat = exm_data,
    minPairCorr = 0.1,
    probes_ls = exm_sites,
    method = "spearman"
  )
  
  SitesToRegion(
    sitesSubregion_df = exm_regions,
    keepminPairwiseCor_df = exm_cor$keepminPairwiseCor_df
  )
   

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