Created
March 28, 2016 20:41
-
-
Save zakandrewking/31cc254617d15160391f to your computer and use it in GitHub Desktop.
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
# inputs | |
# model, old_gene, new_gene | |
for reaction in model.genes.get_by_id(old_gene).reactions: | |
reaction.gene_reaction_rule = re.sub(r'\b' + old_gene + r'\b', new_gene, | |
reaction.gene_reaction_rule) | |
remove_genes(model, [g for g in model.genes if len(g.reactions) == 0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment