-
-
Save cdanielmachado/826d8199b5e2019c4389d7295504f238 to your computer and use it in GitHub Desktop.
gene - reaction - metabolite associations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from framed import load_cbmodel | |
import pandas as pd | |
model = load_cbmodel("iML1515.xml.gz", flavor="bigg") | |
gene2met = [(g_id, r_id, m_id) for r_id, rxn in model.reactions.items() | |
for g_id in rxn.get_associated_genes() | |
for m_id in rxn.stoichiometry] | |
df = pd.DataFrame(gene2met, columns=["metabolites", "reactions", "genes"]) | |
df.to_csv("associations.tsv", sep="\t", index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment