Description Usage Arguments Details Value Examples
This function computes the precision of a co-expression network at top edges i.e., the fraction of true edges in a given number of top weighted edges. It has options to set the number of top edges and the known score thresholds to define which edges are true.
1 2 3 4 5 6 7 8 | coexpression_known_interactions_precision_at_top(
net,
known,
score.thresholds,
n.top.edges = NA,
na.ignore = "known",
neg.treat = "error"
)
|
net |
matrix or data.frame. A gene x gene matrix representing edge weights between genes in a co-expression network. See details. |
known |
matrix or data.frame. A gene x gene matrix representing the probability that edges between genes true. See details. |
score.thresholds |
numeric vector. Each value must be in the rage [0,1]. If known interaction score is equal to or greater than a score threshold, the corresponding edge is considered true. |
n.top.edges |
vector with numeric values or |
na.ignore |
character representing how |
neg.treat |
character representing how negative values in |
Each value in known
must be in the range [0, 1] representing
the probability that the corresponding edge (interaction) is true.
While the values in net
are not limited to any range,
each value should represent the relative probability that
the corresponding edge is true. In other words, larger values should
represent higher confidence in corresponding edges.
If the sign of values in net
represents positive or negative
associations between genes, you probably should provide absolute values.
If you still want to allow negative values in net
,
you may set neg.treat = "allow"
.
In this case, any negative value will represent lower confidence than
any non-negative value.
Both net
and known
must be square matrices of same dimension.
Either both or none of the matrices should have row and column names.
If available, the set of row names and column names must be unique and same in each matrix.
The set of row and columns names of both matrices should also be same.
Both matrices must be symmetric when rows and columns are in the same order.
Diagonal entries in the matrices are ignored.
A matrix with length(score.thresholds)
rows and
length(n.top.edges)
columns.
Each value in the matrix represent the precision at a given number of top edges (column)
using a given score threshold (row).
1 2 3 4 5 6 7 8 9 10 11 12 | genes = sprintf("G%d", 1:10)
dummy_net = matrix(rnorm(length(genes)^2), nrow = length(genes), dimnames = list(genes, genes))
dummy_net = abs((dummy_net + t(dummy_net))/2) # symmetric network
dummy_ppi = abs(dummy_net + rnorm(length(dummy_net)))
dummy_ppi = (dummy_ppi + t(dummy_ppi)) / (2 * max(dummy_ppi)) # symmetric ppi
net_precision = coexpression_known_interactions_precision_at_top(
net = dummy_net,
known = dummy_ppi,
n.top.edges = c(10, 30, NA),
score.thresholds = c(0.25, 0.5)
)
print(net_precision)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.