-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainCode_Example.R
More file actions
42 lines (35 loc) · 1.48 KB
/
Copy pathMainCode_Example.R
File metadata and controls
42 lines (35 loc) · 1.48 KB
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
37
38
39
40
41
42
############# Main code for reproducing the results of paper ##############
## Identification of deregulation mechanisms specific to cancer subtypes ##
# load the libraries
library(CoRegNet)
library(doParallel)
library(stringr)
library(glmnet)
# Define your path and target directory
TargetDirectory <- "results/" # before running the algorithm, a "results" folder must be created
pathEM <- "algoEM/"
DataDirectory <- "data_TCGA/"
source("MainCode.R")
# load the TCGA data
load(paste0(DataDirectory,"ProcessedData_BLCA.Rdata"))
MA <- t(ProcessedData$MA_TCGA)
CNV <- t(ProcessedData$CNV_TCGA)
# load the different subtypes
load(paste0(DataDirectory,"/ConsensusSubtypes.Rdata"))
Subtypes <- subtypes
names(Subtypes) <- substr(names(Subtypes), 0, 15)
Subtypes <- Subtypes[rownames(MA)]
# list of transcription factors
TFs <- read.table(paste0(DataDirectory,"AllHumanTranscriptionFactor.txt"))
TFs <- TFs$V1
# set parameters
VarMax <- 0.75 # filter for genes, keep only the top VarMax % variant genes
# Run the main code
subtypes <- names(which(Subtypes==unique(Subtypes)[1])) # for the 1st subtype
Results <- DeregGenes(MA_cancer = MA[subtypes,],
MA_normal = MA[!(rownames(MA)%in%subtypes),],
TFs = TFs,
CNV_matrix = CNV,CNV_correction = TRUE,
VarMax=VarMax,
LicornThresholds=list(minCoregSupport=0.5,searchThresh=0.5),
TargetDirectory = TargetDirectory, pathEM = pathEM)