## Conver a metabolic network to a reaction network.
data(ex_sbml) # bipartite metabolic network of Carbohydrate metabolism.
rgraph <- makeReactionNetwork(ex_sbml, simplify=TRUE)
## Assign edge weights based on Affymetrix attributes and microarray dataset.
# Calculate Pearson's correlation.
data(ex_microarray) # Part of ALL dataset.
rgraph <- assignEdgeWeights(microarray = ex_microarray, graph = rgraph,
weight.method = "cor", use.attr="miriam.uniprot",
y=factor(colnames(ex_microarray)), bootstrap = FALSE)
# Using Spearman correlation, assigning missing edges to -1
## Not run:
# assignEdgeWeights(microarray, graph, use.attr="miriam.affy.probeset",
# y=factor(colnames(microarray)),
# weight.method = function(x1,x2) cor(x1,x2, method="spearman),
# missing.method = -1)
# ## End(Not run)
Run the code above in your browser using DataLab