Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add files via upload
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Appendix 1 � R-code | ||
|
||
|
||
|
||
|
||
#Normalization | ||
|
||
|
||
library(gcrma) | ||
|
||
#in the following line, replace CEL directory and CDF name with respective folder and name of your custom CDF | ||
|
||
set <- ReadAffy(celfile.path=<CEL directory>, cdfname = <custom CDF name>) | ||
|
||
nset <- gcrma(set) | ||
|
||
|
||
|
||
|
||
#Differential expression | ||
|
||
|
||
library(limma) | ||
|
||
design <- model.matrix(~ 0+factor(c(1,1,2,2))) | ||
|
||
# exemplary design matrix for the case that samples 1 and 2 are control, 3 and 4 are treatment; adjust accordingly | ||
|
||
fit <- lmFit(nset, design) | ||
|
||
fit <- eBayes(fit) | ||
|
||
topTable(fit) | ||
|
||
|
||
|
||
|
||
#Induced network modules | ||
|
||
|
||
library(BioNet) | ||
|
||
#in the following line, replace PPI file with the file name of the PPI in standard interaction format (.sif) | ||
|
||
ppi <- read.csv(<PPI file in sif>, sep="\t", header=T) | ||
|
||
ppiG <- ftM2graphNEL(ppi, edgemode="undirected") | ||
|
||
#in the following line, replace diffEx file with the table acuired in Method 3.1.2 step 5 | ||
|
||
deData <- read.csv(<diffEx file>, sep="\t", header=T) | ||
|
||
subnet <- subNetwork(deData$Gene.ID, ppiG) | ||
|
||
fb <- fitBumModel(pval, plot = FALSE) | ||
|
||
#pval = 0.05, for example | ||
|
||
scores <- scoreNodes(subnet, fb, fdr = 0.01) | ||
|
||
#play around with the fdr value to acquire modules of interpretable size | ||
|
||
module <- runFastHeinz(subnet, scores) | ||
|
||
plotModule(module, scores = scores, diff.expr = logFC) | ||
|