Code Monkey home page Code Monkey logo

mergem's Issues

mergem translate tool does not transfer new ID's to model

Hello! I am trying to translate a modelSEED model to a model that uses bigg ID's, I have tried using the command line and python script.

import mergem
from mergem import translate, load_model, save_model, map_localization, map_metabolite_univ_id, map_reaction_univ_id, get_metabolite_properties, get_reaction_properties, update_id_mapper
   
translated_model = mergem.translate(model, 'bigg')

and:

import mergem
from mergem import translate, load_model, save_model, map_localization, map_metabolite_univ_id, map_reaction_univ_id, get_metabolite_properties, get_reaction_properties, update_id_mapper
    
translated_model = mergem.translate(model, trans_to_db='bigg')

Neither versions return a model object with translated model ID's.

On command line, it looks like the translations are taking place, but the final model that is saved as "translated" does not contain bigg ID's.

(cobrapy_env) nfarooqi@M4819 gsm % mergem lhelveticus.sbml -t bigg
mergem, v0.26.2
Model does not contain SBML fbc package information.
SBML package 'layout' not supported by cobrapy, information is not parsed
SBML package 'render' not supported by cobrapy, information is not parsed
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00443_c0 "ABEE_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd02920_c0 "2_Amino_4_hydroxy_6_hydroxymethyl_7_8_dihydropteridinediphosphate_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00012_c0 "PPi_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00067_c0 "H_plus__c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00683_c0 "Dihydropteroate_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00114_c0 "IMP_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00103_c0 "PRPP_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00226_c0 "HYXN_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00001_c0 "H2O_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd01759_c0 "N_Acyl_L_aspartate_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00041_c0 "L_Aspartate_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00049_c0 "Carboxylic_acid_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00002_c0 "ATP_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00008_c0 "ADP_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00009_c0 "Phosphate_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00947_c0 "LacCer_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00108_c0 "Galactose_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00878_c0 "Glucocerebroside_c0">
Use of the species charge attribute is discouraged, use fbc:charge instead: <Species M_cpd00022_c0 "Acetyl_CoA_c0">
cont....

Any ideas on how to resolve thi? Or perhaps I'm using the tool incorrectly?

cobra version

Hi there and thanks for the great resource!

It is my belief that you need to change in your requirements.txt the cobra version.

You are using the cobra.core.Gene.GPR class and I think it was first introduced in cobra==0.24.0.

Here is the initial commit of the class.

Enable only mapping of IDs

Hey, this looks great!
The mapping you do here seems very thorough, but would it be possible to map the namespace of one model to a different namespace without actually merging models?

IndexError: list index out of range

Hi, I'm trying to merge about 200 models into one
image

First I tried with only 2 and it raised this error:

merge_results = mergem.merge(["test/Abiotrophia_defectiva_ATCC_49176.xml","test/Acidaminococcus_fermentans_DSM_20731.xml"], 1)


IndexError Traceback (most recent call last)
/tmp/ipykernel_20689/2630019269.py in
----> 1 merge_results = mergem.merge(["test/Abiotrophia_defectiva_ATCC_49176.xml", "test/Acidaminococcus_fermentans_DSM_20731.xml"], 1)

~/anaconda3/lib/python3.9/site-packages/mergem/__mergeModels.py in merge(input_models, set_objective)
54 merged_model_metabolites.append(metabolite)
55 old_met_id = metabolite.id
---> 56 new_met_id = map_metabolite_to_mergem_id(metabolite)
57
58 if (new_met_id is None) or (new_met_id in met_sources_dict):

~/anaconda3/lib/python3.9/site-packages/mergem/__mergeModels.py in map_metabolite_to_mergem_id(metabolite)
234 else:
235 split = met_id.rsplit("_", 1)
--> 236 met_compartment = __modelHandling.map_localization(split[1])
237 if met_compartment == '':
238 met_compartment = split[1]

IndexError: list index out of range

==========================================
Some search said this error with the models itself, is there anway to fix this with all models?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.