|
a |
|
b/AMARETTO_EXAMPLE/AMARETTO.R |
|
|
1 |
#------------------------------------------------------------------------------------------------- |
|
|
2 |
#------------------------------------------------------------------------------------------------- |
|
|
3 |
## AMARETTO: Regulatory network inference and driver gene evaluation using |
|
|
4 |
## integrative multi-omics analysis and penalized regression |
|
|
5 |
## For details on the implementation visit |
|
|
6 |
## https://github.com/gevaertlab/AMARETTO |
|
|
7 |
#------------------------------------------------------------------------------------------------- |
|
|
8 |
#------------------------------------------------------------------------------------------------- |
|
|
9 |
########################################################## |
|
|
10 |
###################### Example R Script ################## |
|
|
11 |
########################################################## |
|
|
12 |
#----------------------------------------------------------------------------------------- |
|
|
13 |
# 1. Installing AMARETTO and loading the package: |
|
|
14 |
#----------------------------------------------------------------------------------------- |
|
|
15 |
install.packages("BiocManager") |
|
|
16 |
BiocManager::install("gevaertlab/AMARETTO") |
|
|
17 |
library(AMARETTO) |
|
|
18 |
|
|
|
19 |
resdir <- file.path("AMARETTO_Results");if(!file.exists(resdir)) dir.create(resdir) #Absolute path to data results directory |
|
|
20 |
setwd(resdir) |
|
|
21 |
#----------------------------------------------------------------------------------------- |
|
|
22 |
# 2. Dowloading TCGA input data for analysis |
|
|
23 |
#----------------------------------------------------------------------------------------- |
|
|
24 |
TargetDirectory <- file.path(getwd(),"Downloads/");if(!file.exists(TargetDirectory)) dir.create(TargetDirectory) #Absolute path to data download directory |
|
|
25 |
CancerSite <- "LIHC" |
|
|
26 |
DataSetDirectories <- AMARETTO_Download(CancerSite,TargetDirectory = TargetDirectory) |
|
|
27 |
|
|
|
28 |
#----------------------------------------------------------------------------------------- |
|
|
29 |
# 3. Preprocessing the downloaded TCGA data |
|
|
30 |
#----------------------------------------------------------------------------------------- |
|
|
31 |
#ProcessedData <- AMARETTO_Preprocess(DataSetDirectories,BatchData) |
|
|
32 |
|
|
|
33 |
#load(inst/extdata//MethylStates.rda) #MethylMix preprocessed data for CancerSite |
|
|
34 |
#ProcessedData[[3]] <- MethylStates[CancerSite] #MethylMix preprocessed data for CancerSite |
|
|
35 |
|
|
|
36 |
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# |
|
|
37 |
# Loading preprocessed TCGA-LAML example dataset: |
|
|
38 |
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# |
|
|
39 |
data("ProcessedDataLIHC") |
|
|
40 |
|
|
|
41 |
#----------------------------------------------------------------------------------------- |
|
|
42 |
# 4. Running AMARETTO |
|
|
43 |
#----------------------------------------------------------------------------------------- |
|
|
44 |
AMARETTOinit <- AMARETTO_Initialize(ProcessedDataLIHC,NrModules = 2, VarPercentage = 60) |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
AMARETTOresults <- AMARETTO_Run(AMARETTOinit) |
|
|
48 |
|
|
|
49 |
AMARETTOtestReport <- AMARETTO_EvaluateTestSet(AMARETTOresults = AMARETTOresults, |
|
|
50 |
MA_Data_TestSet = AMARETTOinit$MA_matrix_Var, |
|
|
51 |
RegulatorData_TestSet = AMARETTOinit$RegulatorData) |
|
|
52 |
|
|
|
53 |
#----------------------------------------------------------------------------------------- |
|
|
54 |
# 4. Visualize AMARETTO modules |
|
|
55 |
#----------------------------------------------------------------------------------------- |
|
|
56 |
ModuleNr <- 1 #define the module number to visualize |
|
|
57 |
|
|
|
58 |
AMARETTO_VisualizeModule(AMARETTOinit = AMARETTOinit,AMARETTOresults = AMARETTOresults, |
|
|
59 |
ProcessedData = ProcessedDataLIHC,ModuleNr = ModuleNr) |
|
|
60 |
|
|
|
61 |
#----------------------------------------------------------------------------------------- |
|
|
62 |
# 5. Get HTML report for AMARETTO modules |
|
|
63 |
#----------------------------------------------------------------------------------------- |
|
|
64 |
|
|
|
65 |
AMARETTO_HTMLreport(AMARETTOinit,AMARETTOresults,ProcessedDataLIHC,VarPercentage=10,hyper_geo_test_bool=FALSE,output_address=resdir) |