Calculating the metabolic complementarity index and complementarity index of based on species metabolic network.
complementarityIndex(g1, g2, seed.set1, seed.set2, threshold = 0, p = FALSE, nperm = 1000) competitionIndex(g1, g2, seed.set1, seed.set2, threshold = 0, p = FALSE, nperm = 1000)
seedset-class
.seedset-class
.a two length list: complementarity index or competition index: range from 0 to 1, p value of complementarity index. Or a single value of complementarity or competition index while p is FALSE.
Metabolic competition index is defined as the fraction of compounds in a species seed set of metabolic network that are also included in its partner; However, metabolic complementarity index is the fraction of compounds in one species seed set of metabolic network appearing in the metabolic network but not in the seed set of its partner. However, seed compounds are associated with a confidence score (1/size of SCC), so this fraction is calculated as a normalized weighted sum.
Based on the metabolic network and seed sets of species, this functions help us to predict the species interactions of species1 on the presence of species2.
getSeedSets
,
calculateCooperationIndex
## Not run: ------------------------------------ # ## metabolic network reconstruction and seed set identity of sample data anno.species # net <- lapply(anno.species,reconstructGsMN) # seed.sets <- lapply(net, getSeedSets) # seed.sets <- lapply(seed.sets, function(x)x@seeds) # # ## calculate the complementarity index of the first species # complementarity.index <- complementarityIndex(net[[1]],net[[2]], # seed.sets[[1]], seed.sets[[2]]) # competition.index <- competitionIndex(net[[1]],net[[2]], # seed.sets[[1]], seed.sets[[2]]) ## ---------------------------------------------