Regulatory interactions


i) interactions for which both regulatory gene and regulatory target are found in the queryset ii) interactions for which only the regulatory gene is found in the queryset iii) interactions for which only the regulatory target is found in the queryset - Interactions are ranked according to confidence, visualized in varying shades of blue (from   low-confident interactions     to   high-confident interactions   ).

We interrogate interactions in the query set for two separate collections of regulatory interactions in DoRothEA:

  1. regulatory interactions inferred with gene expression from GTex (global set),
  2. regulatory interactions inferred with gene expression from TCGA (cancer-focused set)



reg_interactions <- list()
active_tab <- list()
for(cl in c('global','pancancer')){
  reg_interactions[[cl]] <- list()
  active_tab[[cl]] <- list()

  reg_interactions[[cl]][['tf_target']] <- data.frame()
  reg_interactions[[cl]][['tf_only']] <- data.frame()
  reg_interactions[[cl]][['target_only']] <- data.frame()

  active_tab[[cl]][['tf_target']] <- F
  active_tab[[cl]][['tf_only']] <- F
  active_tab[[cl]][['target_only']] <- F

  if(NROW(onc_enrich_report[['data']][['regulatory']][['interactions']][[cl]]) > 0){
    reg_interactions[[cl]][['tf_target']] <- 
      onc_enrich_report[['data']][['regulatory']][['interactions']][[cl]] |>
      dplyr::filter(stringr::str_detect(queryset_overlap,"TF_TARGET_")) |>
      dplyr::select(-c(regulator_cancer_max_rank,
                       target_cancer_max_rank)) |>
      head(2500)

    if(NROW(reg_interactions[[cl]][['tf_target']]) > 0){
      active_tab[[cl]][['tf_target']] <- T
    }

    reg_interactions[[cl]][['tf_only']] <- 
      onc_enrich_report[['data']][['regulatory']][['interactions']][[cl]] |>
      dplyr::filter(stringr::str_detect(queryset_overlap,"^(TF_(A|B|C|D))$")) |>
      dplyr::select(-c(regulator_cancer_max_rank,
                       target_cancer_max_rank)) |>
      head(2500)

    if(NROW(reg_interactions[[cl]][['tf_only']]) > 0 & 
       active_tab[[cl]][['tf_target']] == F){
      active_tab[[cl]][['tf_only']] <- T
    }

    reg_interactions[[cl]][['target_only']] <- 
      onc_enrich_report[['data']][['regulatory']][['interactions']][[cl]] |>
      dplyr::filter(stringr::str_detect(queryset_overlap,"^(TARGET_(A|B|C|D))$")) |>
      dplyr::select(-c(regulator_cancer_max_rank,
                       target_cancer_max_rank)) |>
      head(2500)

    if(NROW(reg_interactions[[cl]][['target_only']]) > 0 & 
       active_tab[[cl]][['tf_target']] == F &
       active_tab[[cl]][['tf_only']] == F){
      active_tab[[cl]][['target_only']] <- T
    }
  }
}

for(cl in c('global','pancancer')){
  if(active_tab[[cl]][['tf_target']] == F & 
     active_tab[[cl]][['tf_only']] == F & 
     active_tab[[cl]][['target_only']] == F){
    active_tab[[cl]][['tf_target']] <- T
  }
}

DoRothEA - global set {.tabset}

if(active_tab[['global']][['tf_target']] == T){
  cat("")
  cat("##### Regulatory gene and target {.active}")
  cat("")
}else{
  cat("")
  cat("##### Regulatory gene and target")
  cat("")
}
tf_target_sd <- 
  crosstalk::SharedData$new(reg_interactions[['global']][['tf_target']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", tf_target_sd, ~regulator)
  ),
  list(
    crosstalk::filter_select("target_gene", "Target", tf_target_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", tf_target_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  tf_target_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  ) |>
  DT::formatStyle(
    'regulator', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["tf_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["tf_colors"]]
    )
  ) |>
  DT::formatStyle(
    'target', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["target_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["target_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - global set) for which <b>BOTH</b> the regulatory gene and the target are part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')


if(active_tab[['global']][['tf_only']] == T){
  cat("")
  cat("##### Regulatory gene only {.active}")
  cat("")
}else{
  cat("")
  cat("##### Regulatory gene only")
  cat("")
}
tf_only_sd <- 
  crosstalk::SharedData$new(reg_interactions[['global']][['tf_only']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", tf_only_sd, ~regulator)
  ),
  list(
    crosstalk::filter_select("target_gene", "Target", tf_only_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", tf_only_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  tf_only_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  ) |>
  DT::formatStyle(
    'regulator', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["tf_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["tf_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - global set) for which <b>ONLY</b> the regulatory gene is part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')


if(active_tab[['global']][['target_only']] == T){
  cat("")
  cat("##### Target only {.active}")
  cat("")
}else{
  cat("")
  cat("##### Target only")
  cat("")
}
target_only_sd <- 
  crosstalk::SharedData$new(reg_interactions[['global']][['target_only']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", target_only_sd, ~regulator)
  ),
  list(
    crosstalk::filter_select("target_gene", "Target", target_only_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", target_only_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  target_only_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  )  |>
  DT::formatStyle(
    'target', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["target_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["target_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - global set) for which <b>ONLY</b> the regulatory target is part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')


DoRothEA - cancer-focused set {.tabset}

if(active_tab[['pancancer']][['tf_target']] == T){
  cat("")
  cat("##### Regulatory gene and target {.active}")
  cat("")
}else{
  cat("")
  cat("##### Regulatory gene and target")
  cat("")
}
tf_target_pancancer_sd <- 
  crosstalk::SharedData$new(reg_interactions[['pancancer']][['tf_target']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", tf_target_pancancer_sd, ~regulator),
    crosstalk::filter_select("mode_of_regulation", "Mode of regulation", tf_target_pancancer_sd, ~mode_of_regulation)

  ),
  list(
    crosstalk::filter_select("target_gene", "Target", tf_target_pancancer_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", tf_target_pancancer_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  tf_target_pancancer_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  ) |>
  DT::formatStyle(
    'regulator', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["tf_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["tf_colors"]]
    )
  ) |>
  DT::formatStyle(
    'target', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["target_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["target_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - cancer-focused set) for which <b>BOTH</b> the regulatory gene and the target are part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')


if(active_tab[['pancancer']][['tf_only']] == T){
  cat("")
  cat("##### Regulatory gene only {.active}")
  cat("")
}else{
  cat("")
  cat("##### Regulatory gene only")
  cat("")
}
tf_only_pancancer_sd <- 
  crosstalk::SharedData$new(reg_interactions[['pancancer']][['tf_only']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", tf_only_pancancer_sd, ~regulator),
    crosstalk::filter_select("mode_of_regulation", "Mode of regulation", tf_only_pancancer_sd, ~mode_of_regulation)
  ),
  list(
    crosstalk::filter_select("target_gene", "Target", tf_only_pancancer_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", tf_only_pancancer_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  tf_only_pancancer_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  ) |>
  DT::formatStyle(
    'regulator', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["tf_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["tf_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - cancer- focused set) for which <b>ONLY</b> the regulatory gene is part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')


if(active_tab[['pancancer']][['target_only']] == T){
  cat("")
  cat("##### Target only {.active}")
  cat("")
}else{
  cat("")
  cat("##### Target only")
  cat("")
}
target_only_pancancer_sd <- 
  crosstalk::SharedData$new(reg_interactions[['pancancer']][['target_only']])

crosstalk::bscols(
  list(
    crosstalk::filter_select("transcription_regulator", "Regulator", target_only_pancancer_sd, ~regulator),
        crosstalk::filter_select("mode_of_regulation", "Mode of regulation", target_only_pancancer_sd, ~mode_of_regulation)

  ),
  list(
    crosstalk::filter_select("target_gene", "Target", target_only_pancancer_sd, ~target),
    crosstalk::filter_select("confidence_level", "Confidence level (interaction)", target_only_pancancer_sd, ~confidence_level)
  )
)

htmltools::br()

DT::datatable(
  target_only_pancancer_sd, 
  escape = F, 
  extensions=c("Buttons","Responsive"), 
  width = "100%",
  style = 'bootstrap',
  rownames = F,
  options=list(buttons = c('csv','excel'),
               pageLength = 10,
               bPaginate = T,
               dom = 'Bfrtip')
  )  |>
  DT::formatStyle(
    'target', 
    'queryset_overlap',
    color = "white",
    backgroundColor = DT::styleEqual(
      onc_enrich_report[["config"]][["regulatory"]][["target_levels"]],
      onc_enrich_report[["config"]][["regulatory"]][["target_colors"]]
    )
  )



cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> genes in the queryset are involved in regulatory interactions (DoRothEA - cancer-focused set) for which <b>ONLY</b> the regulatory target is part of the queryset.&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')

Key regulatory network interactions



regulatory_nodes <- onc_enrich_report[['data']][['regulatory']][['network']][['nodes']]
regulatory_edges <- onc_enrich_report[['data']][['regulatory']][['network']][['edges']]

visNetwork::visNetwork(regulatory_nodes, regulatory_edges) |> 
  visNetwork::visInteraction(multiselect=TRUE, tooltipDelay=300) |>
  visNetwork::visLegend()
  #visNetwork::visIgraphLayout(layout="layout_nicely")
cat('\n <ul><li>  <i> <span style="font-size: 105%; padding: 3px; background-color:#989898; color:white">&nbsp;&nbsp;<b>NO</b> pair of genes in the queryset are involved in regulatory interactions (<b>as reported in DoRothEA - cancer-focused set</b>)&nbsp;&nbsp; </span></i></li></ul>',sep='\n')
cat('\n')
cat('<br><br>')



{.unlisted .unnumbered .toc-ignore}

  Citation Note   : If you use the output of the Regulatory interactions module of oncoEnrichR in your research, please cite the following resources and tools:





sigven/oncoEnrichR documentation built on Aug. 31, 2023, 8:05 a.m.