Description Usage Arguments Value Author(s) Examples
This function computes edge weights based on a gene expression profile.
1 2 3 | assignEdgeWeights(microarray, graph, use.attr, y, weight.method = "cor",
complex.method = "max", missing.method = "median",
same.gene.penalty = "median", bootstrap = 100, verbose = TRUE)
|
microarray |
Microarray should be a Dataframe or a matrix, with genes as rownames, and samples as columns. |
graph |
An annotated igraph object. |
use.attr |
An attribute name to map |
y |
Sample labels, given as a factor or a character vector. This must be the same size as the columns of |
weight.method |
A function, or a string indicating the name of the function to be used to compute the edge weights.
The function is provided with 2 numerical verctors (2 rows from |
complex.method |
A function, or a string indicating the name of the function to be used in weighting edges connecting complexes.
If a vertex has >1 attribute value, all possible pairwise weights are first computed, and given to |
missing.method |
A function, or a string indicating the name of the function to be used in weighting edges when one of the vertices
lack expression data. The function is passed all edge weights on the graph. Default is |
same.gene.penalty |
A numerical value to be assigned when 2 adjacent vertices have the same attribute value, since correlation and
similarity measure will give perfect scores. Alternatively, |
bootstrap |
An integer |
verbose |
Print the progress of the function. |
The input graph with edge.weight
as an edge attribute. The attribute can be a list of weights if y
labels
were provided.
Ahmed Mohamed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Convert 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.