generateTFList: 'generateTFList'

Description Usage Arguments Value Author(s) Examples

View source: R/generateTFList.R

Description

assignPROGENyScores

Usage

1
2
generateTFList(df = TF_activities, top = 50, 
                            access_idx = 1)

Arguments

df

the inferred TF activities from viper function

top

the top TF's with highes absolute activity values to be generated for the CARNIVAL analysis. Default set to top=50. When considering all TF's, then top="all"

access_idx

index of the sample to consider (default set to access_idx = 1 - generate table for the first TF sample (if all, set access_idx = 1:ncol(df)))

Value

This function creates a regulon list similar to vipper from an interaction matrix. The interaction matrix contains as columns the source, sign and the target of the interaction

Author(s)

Enio Gjerga

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
library(CARNIVAL)
library(OmnipathR)
library(viper)
library(progeny)

expr <- as.matrix(read.csv(system.file("extdata", "human_input.csv", 
                                              package = "progeny"), 
                                              row.names = 1))

regulon_df <- 
  import_TFregulons_Interactions(select_organism = 9606)

regulon_df <- 
  regulon_df[which((regulon_df$is_stimulation+regulon_df$is_inhibition)==1), ]

regulon_table <- matrix(data = , nrow = nrow(regulon_df), ncol = 3)
regulon_table[, 1] <- regulon_df$source_genesymbol
regulon_table[which(regulon_df$is_stimulation==1), 2] = "1"
regulon_table[which(regulon_df$is_inhibition==1), 2] = "-1"
regulon_table[, 3] <- regulon_df$target_genesymbol

regulons <- createRegulonList(regulon_table = regulon_table)

TF_activities = as.data.frame(viper::viper(eset = expr, 
                                           regulon = regulons, nes = T, 
                                           method = 'none', minsize = 4, 
                                           eset.filter = F))

tfList <- generateTFList(df = TF_activities, top = "all", 
                            access_idx = 1)

saezlab/CARNIVAL-Bioconductor-Dev documentation built on Aug. 30, 2020, 2:39 p.m.