cdanielmachado / smetana

SMETANA: a tool to analyse interactions in microbial communities
Other
56 stars 11 forks source link

Smetana on Gapseq models #12

Closed arianccbasile closed 3 years ago

arianccbasile commented 3 years ago

Dear Daniel, I am trying smetana on models created by Gapseq source (https://github.com/jotech/gapseq). I tried to use it with the global algorithm and setted --ext to e0 to change the extracellular compartment identifier in the models. However, I get an error from an inner compound probably always due to compartments nomenclature. Here the command line and the error I get. Do you have any suggestion?

smetana --global *.xml --flavor fbc2 --verbose --ext e0

Loading community: all
Traceback (most recent call last):
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/bin/smetana", line 468, in <module>
    ignore_coupling=args.no_coupling,
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/bin/smetana", line 333, in main
    comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/bin/smetana", line 333, in <listcomp>
    comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/io/cache.py", line 24, in get_model
    model = load_cbmodel(self.paths[model_id], **self.load_args)
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/io/sbml.py", line 146, in load_cbmodel
    load_gprs=load_gprs, load_metadata=load_metadata)
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/io/sbml.py", line 104, in load_sbml_model
    load_gprs=load_gprs, load_metadata=load_metadata)
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/io/sbml.py", line 306, in _load_cbmodel
    _load_metabolites(sbml_model, model, flavor, load_metadata=load_metadata)
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/io/sbml.py", line 180, in _load_metabolites
    model.add_metabolite(_load_metabolite(species, flavor, load_metadata=load_metadata), clear_tmp=False)
  File "/mnt/data_SSD/anaconda3/envs/flux_balance/lib/python3.6/site-packages/framed/model/model.py", line 323, in add_metabolite
    raise KeyError("Failed to add metabolite '{}' (invalid compartment)".format(metabolite.id))
KeyError: "Failed to add metabolite 'M_cpd15561_c0' (invalid compartment)"

Best, Arianna Basile

cdanielmachado commented 3 years ago

Hi Arianna,

Can you send me a model by email or point to a URL for download?

Best regards, Daniel

arianccbasile commented 3 years ago

Just sent to the new e-mail.

Sincerely, Arianna

cdanielmachado commented 3 years ago

Here is the problem:

<species metaid="M_cpd15561_c0" id="M_cpd15561_c0" name="cpd15561[c0]" compartment="NA"

If you run this using SBML Validator it will tell you it is not a valid SBML file.

cdanielmachado commented 3 years ago

By the way, in this model there are only two metabolites with "NA" compartments, so you can easily fix that manually.

arianccbasile commented 3 years ago

Of course I have a big community and many others "NA" will be present but I will manage, by the way thank you a lot for your fast answer and the help provided.

Best, Arianna

cdanielmachado commented 3 years ago

You can easily write a script to replace all the "NA" values, but you should probably submit an issue in the gapseq website as well :)

arianccbasile commented 3 years ago

I have already done :) both