if __name__ == '__main__': #- Get all metabolic pathways of all E. coli organisms from KEGG. eColiOrganisms = FEV_KEGG.KEGG.Organism.Group( searchString='Escherichia coli K-12').organisms #- For each organism, combine all pathways to the metabolic network, by UNION operation. organismEcGraphs = [] for organism in eColiOrganisms: organismPathways = organism.getMetabolicPathways() organismSubstanceReactionGraph = SubstanceReactionGraph.fromPathway( organismPathways) #- Convert this metabolic network into a substance-ecNumber graph. organismSubstanceGeneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph( organismSubstanceReactionGraph) organismSubstanceEcGraph = SubstanceEcGraph.fromSubstanceGeneGraph( organismSubstanceGeneGraph) organismEcGraphs.append(organismSubstanceEcGraph) firstGraph = organismEcGraphs.pop(0) #- Combine all organisms' networks to a consensus network, by INTERSECT operation, leaving only substances and EC numbers that occur in all organisms. intersectedEcGraph = firstGraph intersectedEcGraph = intersectedEcGraph.intersection(organismEcGraphs) #- Print all EC numbers that occur in all organisms. output = [] for ecNumber in intersectedEcGraph.getECs(): output.append(ecNumber.__str__())
if __name__ == '__main__': #- Get all known pathways of eco and sso from KEGG. eco = FEV_KEGG.KEGG.Organism.Organism('eco') sso = FEV_KEGG.KEGG.Organism.Organism('sso') ecoPathways = eco.getMetabolicPathways() ssoPathways = sso.getMetabolicPathways() #- Convert each pathway into a substance-ecNumber graph. This is the incomplete metabolic network. ecoReactionGraph = SubstanceReactionGraph.fromPathway(ecoPathways) ssoReactionGraph = SubstanceReactionGraph.fromPathway(ssoPathways) ecoGeneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph(ecoReactionGraph) ssoGeneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph(ssoReactionGraph) ecoEnzymeGraph = SubstanceEnzymeGraph.fromSubstanceGeneGraph(ecoGeneGraph) ssoEnzymeGraph = SubstanceEnzymeGraph.fromSubstanceGeneGraph(ssoGeneGraph) #- Remove multifunctional enzymes, meaning enzymes associated with more than one EC number. Helps to reduce false gene duplications. ecoEnzymeGraph.removeMultifunctionalEnzymes() ssoEnzymeGraph.removeMultifunctionalEnzymes() ecoEcGraph = SubstanceEcGraph.fromSubstanceEnzymeGraph(ecoEnzymeGraph) ssoEcGraph = SubstanceEcGraph.fromSubstanceEnzymeGraph(ssoEnzymeGraph) #- Combine both species' networks to a consensus network, by INTERSECTION operation. intersectionEcGraph = ecoEcGraph.intersection(ssoEcGraph)
from FEV_KEGG.KEGG.Organism import Organism if __name__ == '__main__': #- Download pathway definition as KGML. eco = Organism('eco') eco00260 = eco.getPathway('00260') eco01100 = eco.getPathway('01100') #- Convert to substance-reaction graph. eco00260_reactionGraph = SubstanceReactionGraph.fromPathway(eco00260) eco01100_reactionGraph = SubstanceReactionGraph.fromPathway(eco01100) #- Convert to substance-gene graph eco00260_geneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph( eco00260_reactionGraph) eco01100_geneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph( eco01100_reactionGraph) #- Convert to substance-enzyme graph eco00260_enzymeGraph = SubstanceEnzymeGraph.fromSubstanceGeneGraph( eco00260_geneGraph) eco01100_enzymeGraph = SubstanceEnzymeGraph.fromSubstanceGeneGraph( eco01100_geneGraph) #- Get set of enzymes for each graph. eco00260_enzymes = eco00260_enzymeGraph.getEnzymes() eco01100_enzymes = eco01100_enzymeGraph.getEnzymes() #- Calculate difference of enzyme sets. difference_enzymes = eco00260_enzymes.difference(eco01100_enzymes)
if __name__ == '__main__': #- Download pathway description as KGML. eco = Organism('eco') eco01100 = eco.getPathway('01100') allNonOverviewPathways = eco.getMetabolicPathways( includeOverviewMaps=False) #- Convert to substance-reaction graph. eco01100_reactionGraph = SubstanceReactionGraph.fromPathway(eco01100) allNonOverviewPathways_reactionGraph = SubstanceReactionGraph.fromPathway( allNonOverviewPathways) #- Convert to substance-gene graph. eco01100_geneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph( eco01100_reactionGraph) allNonOverviewPathways_geneGraph = SubstanceGeneGraph.fromSubstanceReactionGraph( allNonOverviewPathways_reactionGraph) #- Convert to substance-ec graph. eco01100_ecGraph = SubstanceEcGraph.fromSubstanceGeneGraph( eco01100_geneGraph) allNonOverviewPathways_ecGraph = SubstanceEcGraph.fromSubstanceGeneGraph( allNonOverviewPathways_geneGraph) #- Get set of EC numbers for each graph. eco01100_ecNumbers = eco01100_ecGraph.getECs() allNonOverviewPathways_ecNumbers = allNonOverviewPathways_ecGraph.getECs() #- Calculate difference of EC number sets. difference_ecNumbers = eco01100_ecNumbers.difference(