CreateOutputDF: Create output data in the format of data frame.

Description Usage Arguments Value Examples

View source: R/util_CreateOutputDF.R

Description

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

Usage

1
2
3
4
5
6
7
CreateOutputDF(
  keepSites_df,
  keepContiguousSites_df,
  keepminPairwiseCor_df,
  returnAllSites = FALSE,
  verbose = TRUE
)

Arguments

keepSites_df

An output data frame from function MarkCoeditedSites, with variables site, keep, ind, r_drop. Please see MarkCoeditedSites for details.

keepContiguousSites_df

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

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 data frame with following columns:

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
  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_probes <- split(
    x = exm_regions$site,
    f = exm_regions$subregion
  )
  
  exm_cor <- GetMinPairwiseCor(
    rnaEditCluster_mat = exm_data,
    minPairCorr = 0.1,
    probes_ls = exm_probes,
    method = "spearman"
  )
  
  CreateOutputDF(
    keepSites_df = exm_sites,
    keepContiguousSites_df = exm_regions,
    keepminPairwiseCor_df = exm_cor$keepminPairwiseCor_df
  )
   

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