OncoSigRF: Create and Generate Predictions Using the OncoSig Random...

Description Usage Arguments Value Examples

View source: R/OncoSigRF.R

Description

This function creates the OncoSig Random Forest classifer, and returns predictions generated using Monte-Carlo cross validation. Optionally, the forests generated may be saved, which can be used to generate further predictions.

Usage

1
OncoSigRF(Network_matrix_df, Gold_Standard_in_Network_names, Fraction_Gold_sample = NULL, ntrees = NULL, max_iterations = NULL, balance = NULL, to_save = NULL)

Arguments

Network_matrix_df

A network feature matrix, where the rownames are the points (e..g protein or gene names) to build the classifier on, and the columns are features.

Gold_Standard_in_Network_names

A list of proteins/genes in the gold standard.

Fraction_Gold_sample

Fraction of gold standard to sample in each Monte-Carlo run. Default:.5

ntrees

Number of trees to create in each Random Forest (default:50)

max_iterations

Number of iterations of Monte-Carlo samplings to run (i.e. number of forests ot create) (Default:20)

balance

Ratio of proteins not in the gold sample to sample in each run.Balance of 1 corresponds to an equal number of proteins in the gold sample and not. (Default:1)

to_save

Whether to save the forests created (in a file called "All_forests.R"). This argument must be set to 1 if unsupervised OncoSig is to be used.

Value

Returns a dataframe corresponding to predictions from the Monte-Carlo cross-validation. Higher scores in the first column correspond to higher confidence predictions to be part of the oncogene centric map

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
library (randomForest)
#Process the network
Network_location="Input_data_files/LUAD/original_network.txt"
Network=read.delim(Network_location,header=F)
Network$V1=as.character(Network$V1)
Network$V2=as.character(Network$V2)
Network$V3=as.numeric(Network$V3)
Network=as.matrix(Network)
Gold_Standard_location="Input_data_files/LUAD/10_oncogene_pathways/KRAS/total.txt"
Gold_Standard=read.delim(Gold_Standard_location,header=F)
Gold_Standard$V1=as.character(Gold_Standard$V1)

Network[,3]=as.numeric(Network[,3])
Network_matrix=listToMatrix(Network)


#Convert Matrix to Dataframe for future steps
Network_matrix_df=as.data.frame(Network_matrix)
#Remove Members of Gold Standard Not in the Network:
Gold_Standard_in_Network_names=intersect(rownames(Network_matrix_df),Gold_Standard$V1)
Negative_Set_names=setdiff(rownames(Network_matrix_df),Gold_Standard_in_Network_names)
#Create Negative_standard
#save(Network_matrix,file="Network_matrix.Rda")
remove(Network_matrix)

Query_output_results=OncoSigRF(Network_matrix_df,Gold_Standard_in_Network_names,max_iterations = 5)
Query_output_results_scores=Query_output_results[[1]]

califano-lab/OncoSig documentation built on Oct. 2, 2020, 3:24 p.m.