Code Monkey home page Code Monkey logo

smetana's People

Contributors

cdanielmachado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smetana's Issues

No solver available

Dear cdanielmachado,
I am using smetana with Python 3.7. There is one error when I run the progam as following. Would you please help me to figure out it. Thanks.
joeyxu@login1 13:12:14 /ufrc/nian/joeyxu/work/yunzeng/KOBASE/Fresh
$ smetana *.xml -d
Traceback (most recent call last):
File "/apps/smetana/1.1.0/bin/smetana", line 89, in
main(
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/smetana/interface.py", line 341, in main
entries, debug_entries = run_global(comm_id, community, organisms, medium_id, excluded_mets, env,
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/smetana/interface.py", line 132, in run_global
mip, extras = mip_score(community, environment=env, verbose=verbose,
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/smetana/smetana.py", line 257, in mip_score
noninteracting_medium, sol1 = minimal_medium(noninteracting.merged, exchange_reactions=exch_reactions,
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/reframed/cobra/medium.py", line 50, in minimal_medium
solver = solver_instance(model)
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/reframed/solvers/init.py", line 73, in solver_instance
solver = get_default_solver()
File "/apps/smetana/1.1.0/lib/python3.8/site-packages/reframed/solvers/init.py", line 43, in get_default_solver
raise RuntimeError("No solver available.")
RuntimeError: No solver available.

Model loading Issue with Smetana

I am encountering the following error upon running smetana (Input single species models generated from Carveme).
I tried giving even the test files (uploaded in the githubpage), but encountering the same error.
Can you please help me out t sort this issue?

command used smetana ec_glc_ko.xml ec_nh4_ko.xml --flavor cobra
SMETANA_Error

Comparative Analysis of MIP and MRO Across Variable MAG Compositions and Investigating Cross-Feeding Pathways in Microbial Communities

Hi Daniel,
I'm calculating MIP and MRO based on MAGs assembled from different samples using SMETANA. The number of MAGs assembled varies between each metagenomic sample. Can I compare MIP and MRO between different samples directly? Would the results obtained in this way be meaningful? Here are my two sets of results, calculated based on communities composed of 16 MAGs and 20 MAGs, respectively.
community medium size mip mro
all complete 20 19 0.5905817174515235
community medium size mip mro
all complete 16 11 0.6201550387596899

  Another question is, once I've identified a cross-feeding relationship between two species, A and B, using SMETANA, such as A providing D-Ribose to B, how can I determine the metabolic processes through which A generates D-Ribose and the processes through which B utilizes this D-Ribose?

donor compound receiver
o__QNBC01 M_rib__D_e o__UBA7950
o__Humimicrobiales M_cellb_e o__Methanosarcinales
o__DHVEG-1 M_cellb_e o__Methanosarcinales
o__Humimicrobiales M_man1p_e o__Dehalococcoidales

Thank you in advance!
JackChang

Smetana on Gapseq models

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

RuntimeError: No solver available.

Hi,

I have installed CPLEX on my MacOS and added the /Applications/CPLEX_Studio/cplex/bin/x86-64_osx/cplex solver to my PATH, but I still get the error that no solver can be found. Should I be adding a different location to my PATH?

Thanks

Different MIP and MRO scores for same input -SMETANA

Dear Daniel,
I am running Smetana  - "smetana Lactococcus_raffinolactis_strain_WiKim0068.xml V_harveyi_QT520.xml --mediadb constrained_media_Treh.tsv  --flavor cobra -o TREHALOSE"

I am getting different results when I am executing  this commands with the same set of inputs ----  MIP and MRO score.
community medium size mip mro
all complete 2 2 0.64

community medium size mip mro
all complete 2 1 0.8333333333333334

What would be the reason?
Can you please help me out to sort out this issue.

Thank You

--
Best Regards
N.T.Devika

Failing calculations for global.tsv

Greetings Daniel,

Its been a while since I tinkered with SMETANA, but once again I am having a similar issues as the last issue I inquired about ("Empty detailed.tsv") and was hoping you'd help me out.

To reiterate:
I have made several hundred models using CarveMe as follow:
A. carve --dna assembly.fna --fbc2 -o output_dir #default output, no gapfill, no predefined media
B. carve --dna assembly.fna --init M9 --fbc2 -o output_dir #no gapfill, predefined media
C. carve --dna assembly.fna -g M9 -i M9 --fbc2 -o output_dir #gapfilled on predefined media

For types B & C I have used three different media compositions (M9, artificial root exudates(ARE) and M9+ARE)

The models of type A all grow because they have unlimited media.

ALL of the models of the type B do not grow as per cobrapy's FBA; perhaps we have bad assemblies? The output scores for these look like Example 2, below.

The C models grow as they have been extensively gapped-filled. So I am using these with SMETANA currently. (When I contacted you back in October, I was using the (A) type models and your answer above still holds true for those), but now I'm not sure what's going with the models C....

You explained that "Only when at least one species depends on the others to survive, the smetana score will be larger than zero, and the cross-feeding interactions that mediate the dependency will be listed in the "detailed.tsv" file."---I am getting such results in some detailed.tsv, because as you say, there is likely some dependecy (see Example 1 below).

But I am still not getting any of the other scores MIP, etc. in global.tsv:

Example1: This one follows what you said, if there is growth dependency, then detailed.tsv is populated... why then are the MIP, NIP, and MRO values failing to compute?
This is the case for every community that shows dependency (i.e. has a populated detailed.tsv file)--only the global smetana score is populated.

LjNodule213_LjRoot139_global.tsv 
community | medium | size | mip | nip | mro | smetana
-- | -- | -- | -- | -- | -- | --
all | M9ARE | 2 | Failed | Failed | Failed | 3.0

LjNodule213_LjRoot139_detailed.tsv
community | medium | receiver | donor | compound | scs | mus | mps | smetana
-- | -- | -- | -- | -- | -- | -- | -- | --
all | M9ARE | LjNodule213 | LjRoot139 | M_dtmp_e | 1.0 | 0.09 | 1 | 0.09
all | M9ARE | LjNodule213 | LjRoot139 | M_fol_e | 1.0 | 0.06 | 1 | 0.06
all | M9ARE | LjNodule213 | LjRoot139 | M_fum_e | 1.0 | 0.01 | 1 | 0.01
all | M9ARE | LjNodule213 | LjRoot139 | M_gmp_e | 1.0 | 0.39 | 1 | 0.39
all | M9ARE | LjNodule213 | LjRoot139 | M_h2s_e | 1.0 | 0.04 | 1 | 0.04
.....

============================================================
Example 2: In the next two examples,  I'm assuming that there is no growth dependecy, and so detailed.tsv is not populated, nor can the global.tsv scores be computed...

LjNodule213_LjRoot100_global.tsv
  | community | medium | size | mip | nip | mro | smetana
-- | -- | -- | -- | -- | -- | -- | --
all | M9ARE | 2 | Failed | Failed | Failed | Failed

 LjNodule213_LjRoot100_detailed.tsv
community | medium | receiver | donor | compound | scs | mus | mps | smetana
-- | -- | -- | -- | -- | -- | -- | -- | --

===========================================================
Example 3: However, in this one, the is a global.tsv 'smetana' score, but in Example 2, it fails to compute. This very small difference makes me believe there is a bug somewhere, and it maybe that is also causing the other scores to fail as well.

LjNodule214_LjRoot33_global.tsv 
  | community | medium | size | mip | nip | mro | smetana
-- | -- | -- | -- | -- | -- | -- | --
all | M9ARE | 2 | Failed | Failed | Failed |  

LjNodule214_LjRoot33_detailed.tsv
| community | medium | receiver | donor | compound | scs | mus | mps | smetana
-- | -- | -- | -- | -- | -- | -- | -- | -- | --

Pip install not working in python 2.7

I tried installing using pip install in python 2.7:
(carveme) rafael@rafael-HP-Pavilion-15-Notebook-PC:~$ pip install git+https://github.com/cdanielmachado/smetana
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting git+https://github.com/cdanielmachado/smetana
Cloning https://github.com/cdanielmachado/smetana to /tmp/pip-req-build-0y0vXC
Running command git clone -q https://github.com/cdanielmachado/smetana /tmp/pip-req-build-0y0vXC
ERROR: Could not find a version that satisfies the requirement reframed (from smetana==1.2.0) (from versions: none)
ERROR: No matching distribution found for reframed (from smetana==1.2.0)

Although, it worked with python 3.6

Got an empty file with only the header

Hi,
I used smetana to build an interactive feeding model of a community of 108 strains of bacteria, using the code below:
smetana *.xml -d -o model -m M9[-O2] --mediadb media_db.tsv
But i got an empty file with only the header.
model_detailed.xls
So I want to ask what went wrong in the middle? Is it that you replied to someone else's question: Is it necessary for a single strain to survive under a given medium to simulate the interaction feeding of the flora?
Look forward to hearing from you.
Thank you!

Atomic weight not listed for elements

Hi Daniel,

I'm trying to use SMETANA for a few ModelSEED models, and I was wondering if you could help me with the following issue. I used the --molweight as you had recommended it.

UserWarning: Atomic weight not listed for elements: {'R'} warn(f"Atomic weight not listed for elements: {missing}")

Thanks very much,
Rachita

No output rows in SMETANA detailed.tsv

I tried to run SMETANA on a community of 19 models (generated using genomic DNA using CarveMe) in a custom medium (M9 + glucose) by defining a custom media library (I copied the example library.tsv and replaced the M9[glyc] medium with an M9[gluc] medium by swapping the glycerol row with a glc__D row).

Initially, I received a warning for "MIP: no solution found for non-interacting community".

If I use --flavor bigg, I don't get this warning, but I don't get any output (other than column names) in detailed.tsv.

I am happy to provide my model files and other files to reproduce this error. The models were generated with CarveMe and gapfilled on an M9 medium.

Adjusting the non-CarveMe GEMs to SMETANA

Hi Daniel,

I am trying to use SMETANA with GEMs from different repositories. When I use it with CarveMe-generated GEMs, it works pretty fine.

$ smetana carveme1.xml carveme2.xml carveme3.xml --flavor cobra

However. I encounter an error regarding biomass (objective) recognition when I use smetana with GEMs from different repositories. For instance:

$ smetana agora1.xml agora2.xml yeast.xml --flavor cobra
Of note, exchange metabolite and reaction IDs are unified. Also, biomass reaction IDs contain 'biomass' or 'growth.'

Error: "No biomass reaction identified from model objective."

Of note, the code is executed well if I don't use "--flavor cobra" in the command line. But it does not calculate MIP value, which I think should have sth to do with the biomass reaction recognition problem.

I wonder how to adjust the GEMs to become usable for smetana.

Thank you in advance!
Mohammad

Re-order output file to follow SIF formatting

Love the tool, its been very simple to set up and use, and provides thought provoking results.

This may seem a small quibble, but I thought I would at least ask. Standard simple interaction format (SIF) graph files contain 3 columns, source - relationship - target:

nodeA <relationship type> nodeB

Current Smetana -d output orders as:

Reciever Donor Compound

Relationship type is already implied in SMETANA output, so having a column for it is unnecessary. Unless it is of utmost importance to keep the original order, why not format output to be in line with standard file types, and have the Donor column before the Receiver column?

smetana is not is not recognized as command

Hi,

I wanted to try smetana, the installation went really well but I can't use smetana as a command line.
Do you have an idea why? (I used python 3.6 with Anaconda)

Thank you for your Time!

Changes in result for -d and -g

Hi Daniel,

I am using SMETANA with a small community (models from the last version of carveme, without gapfilling). My output always change for -d which I think is linked to the use of Cplex? What would you suggest to avoid or take into account this variation (e.g different number of interactions)?

I also got different results with -g (using the same input). I tried --molweight just in case but got this error.

cat debug.tsv
community medium key1 key2 data
all complete mip ni 4abz,LalaDgluMdap,acmana,alaala,amp,arg__L,bz,ca2,cgly,cl,cobalt2,cu2,cytd,fe3,frmd,gln__L,gly_asn__L,glyb,glyc3p,hom__L,ile__L,k,lys__L,mg2,mn2,nmn,o2,phe__L,pnto__R,pro__L,quin,ribflv,salchs4fe,so4,thm,tol,tyr__L,uaccg,udcpp,val__L,zn2
all complete mip i 4abz,LalaDgluMdap,acmana,alaala,amp,arg__L,bz,ca2,cgly,cl,cobalt2,cu2,cytd,fe3,frmd,gln__L,gly_asn__L,glyc3p,ile__L,k,lys__L,mg2,mn2,nmn,o2,phe__L,pnto__R,pro__L,quin,ribflv,so4,tol,tyr__L,uaccg,udcpp,val__L,zn2
all complete mro community LalaDgluMdap,acmana,alaala,amp,arg__L,bz,ca2,cgly,chol,cl,cobalt2,cu2,cytd,fe3,fol,frmd,glcur,gln__L,gly_asn__L,glyc3p,ile__L,indole,k,lys__L,mg2,mn2,nmn,phe__L,progly,ribflv,so4,tol,tyr__L,uaccg,udcpp,val__L,zn2
all complete mro M11_Microcystis LalaDgluMdap,acmana,alaala,amp,arg__L,bz,ca2,cl,cobalt2,cu2,cytd,fe2,fe3,fol,frmd,gln__L,gly_asn__L,hom__L,ile__L,indole,k,lys__L,mg2,mn2,nmn,o2,phe__L,pnto__R,progly,ribflv,so4,tyr__L,uaccg,udcpp,val__L,zn2
all complete mro M11_Roseomonas arg__L,ca2,cgly,cl,cobalt2,cu2,cytd,fe3,glcur,glyb,glyc3p,k,lys__L,mg2,mn2,nmn,phe__L,so4,thm,tol,zn2

smetana -g M11_Microcystis.xml M11_Roseomonas.xml --molweight
/home/nico/miniconda3/lib/python3.8/site-packages/smetana/smetana.py:351: UserWarning: MRO: Failed to find a valid solution for: M11_Roseomonas
warn('MRO: Failed to find a valid solution for: ' + org_id)

Thanks for your help!

Nico

N/A from MIP but value from MRO.

Hello,

I am running smetana global on models with '--flavor cobra' and '--molweight'. I am getting values for MRO but my MIP values are only coming back as N/A. Is this normal and interpreted that the solver could not determine if any cooperative interactions take place?

Thank you

issues when add -c communities

$ smetana *.xml -c community.txt
Traceback (most recent call last):
File "/home/qing/miniconda3/envs/metaGEM/bin/smetana", line 106, in
ignore_coupling=args.no_coupling,
File "/home/qing/miniconda3/envs/metaGEM/lib/python3.6/site-packages/smetana/interface.py", line 333, in main
comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
File "/home/qing/miniconda3/envs/metaGEM/lib/python3.6/site-packages/smetana/interface.py", line 333, in
comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
File "/home/qing/miniconda3/envs/metaGEM/lib/python3.6/site-packages/reframed/io/cache.py", line 26, in get_model
raise RuntimeError("Model not in list: " + model_id)
RuntimeError: Model not in list: B51_0_22bin_38_fa

#my model list
B51_0_22bin_14_fa.xml
B51_0_22bin_29_fa.xml
B51_0_22bin_38_fa.xml
B51_0_22bin_60_fa.xml

#commutities
community1 B51_0_22bin_14_fa
community1 B51_0_22bin_29_fa
community2 B51_0_22bin_38_fa
community2 B51_0_22bin_60_fa
community2 B51_0_22bin_29_fa

Inconsistent results of MIP calculation and community minimum growth requirement

Hi Daniel,

I have been doing my research with SMETANA as an important tool for deciding the potential metabolic cooperation between species. From Zelezniak's paper, I learned the MIP value is decided by "community minimum growth requirement". This minimum requirement is also important for my work. So I did some modifications to your smetana code and make the metabolites manifest in the output.

In this previous issue page https://github.com/cdanielmachado/smetana/issues/10 you have mentioned that MIP value might be different for the same input. In fact, the "minimum requirement" also changed (as I observed), and that explains the change of MIP. But it does not make sense because when given a community with several GSMs, the metabolites should directly decide the minimum requirement and MIP. However, they become inconsistent between different runs.

Your explanation would be greatly appreciated if you have any! Thank you!

Emmett

Compatibility with AGORA

Dear Daniel,
I was trying to run SMETANA on some models of the AGORA2 collection but I get error.
Can you suggest the parameters to run it.

Best,
Arianna

AttributeError: issues loading carveme models

Hi Daniel,
Thanks for all the work you put into developing these tools for metabolic modeling and microbial communities!
I'm trying to use smetana but I encounter the following issue regarding an 'AttributeError':


$ smetana model1.xml model2.xml
Traceback (most recent call last):
  File "/home/biol/anaconda2/envs/py3/bin/smetana", line 106, in <module>
    ignore_coupling=args.no_coupling,
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/smetana/interface.py", line 333, in main
    comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/smetana/interface.py", line 333, in <listcomp>
    comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/reframed/io/cache.py", line 31, in get_model
    model = load_cbmodel(self.paths[model_id], **self.load_args)
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/reframed/io/sbml.py", line 147, in load_cbmodel
    load_metabolites(sbml_model, model, flavor, load_metadata)
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/reframed/io/sbml.py", line 219, in load_metabolites
    model.add_metabolite(load_metabolite(species, flavor, load_metadata=load_metadata))
  File "/home/biol/anaconda2/envs/py3/lib/python3.7/site-packages/reframed/io/sbml.py", line 227, in load_metabolite
    if fbc_species.isSetChemicalFormula():
AttributeError: 'NoneType' object has no attribute 'isSetChemicalFormula'

The models I'm trying to use were built with CarveMe.

I also tried using the example data (smetana ec_glc_ko.xml ec_nh4_ko.xml) and had no issues with calculating the scores.

I appreciate the help!

Thanks,
Rudolf

"Reaction R_EX_M_h2o_e_pool not found" error

Hi,

I'm trying to run SMETANA on a collection of Gapseq generated models using the following settings:

  • Mode: detailed
  • aerobic: False
  • Solver: Gurobi 9.2.1

No specified media. When I attempt to run the analysis, I get the following error:

Traceback (most recent call last):
  File "C:/repos/lt-community-modeling/communities/generate_report_artifacts.py", line 1127, in <module>
    threads=2)
  File "C:/repos/lt-community-modeling/communities/generate_report_artifacts.py", line 1098, in execute_site_analysis
    output_directory=os.path.join(output_base_directory, 'smetana'))
  File "C:\repos\lt-community-modeling\communities\consortia\analysis\smetana_analysis.py", line 167, in run_smetana_analysis
    aerobic=False,)
  File "C:\repos\lt-community-modeling\venv\lib\site-packages\smetana\interface.py", line 360, in main
    medium_id, env = define_environment(medium, media_db, community, mode, aerobic, verbose, min_mol_weight, use_lp)
  File "C:\repos\lt-community-modeling\venv\lib\site-packages\smetana\interface.py", line 127, in define_environment
    use_lp=use_lp, max_uptake=max_uptake)
  File "C:\repos\lt-community-modeling\venv\lib\site-packages\smetana\smetana.py", line 380, in minimal_environment
    community.merged.set_flux_bounds("R_EX_M_h2o_e_pool", -inf, inf)
  File "C:\repos\lt-community-modeling\venv\lib\site-packages\reframed\core\cbmodel.py", line 353, in set_flux_bounds
    raise KeyError(f"Reaction {r_id} not found")
KeyError: 'Reaction R_EX_M_h2o_e_pool not found'

I gather that this error is occurring because of a missing reaction in the synthesized community model, but I am unsure how to fix it. Do you have any suggestions about the possible root cause and what I can change on my end? I can specify a media to avoid this issue if necessary.

Compare MRO and MIP across samples

Hi,

This is a question rather than an issue. How to compare MRO and MIP across samples with different number of genomes?

From my understanding, MIP would increase if the number of genome in a sample increase, but I am not sure if it is true for MRO as well. That is, can I divide the MRO and MIP by the number of genomes to obtain normalized MRO and MIP and compare these values across samples?

smetana running error: Assertion failed: teta >= 0.0

Hi,

I'm trying to use SMETANA to analyze my models created by carveme. After pip installing, it reported error as below:

Assertion failed: teta >= 0.0
Error detected in file simplex/spxchuzr.c at line 292
Aborted (core dumped)

I did not find any useful solutions after googling about it so please help to troubleshoot. Thanks.

Emmett

MRO: Failed to find a valid solution

Hi Daniel,
I'm running Smetana on a 12-members community:

smetana *.xml --flavor bigg --molweight -g --debug -v

I am getting this error:

Running MIP for community all on medium complete...
Running MRO for community all on medium complete...
/home/iulia/miniconda3/envs/py3.7/lib/python3.7/site-packages/smetana/smetana.py:351: UserWarning: MRO: Failed to find a valid solution for: MOVI_8.MOVI_8.31_sub.prodigalAnnotation.fullyCharacterized
  warn('MRO: Failed to find a valid solution for: ' + org_id)
Done.

It seems that this flag appears only when model MOVI_8.MOVI_8.31 and some other model (MOVI_8.MOVI_010) are in the same community. If only one of them is present in the community, Smetana works fine.

If I run Smetana only on the 2 problematic models, outside the rest of the community, Smetana works fine.

I can't figure out what the issue might be.

Thank you,
iulia

optimality is not an available tolerance parameter with this solver

(carveme) lizhihua@lizhihua-T640:/media/lizhihua/software/gapseq/gapseq/GJ89_bins$ smetana carveme/*.xml
Traceback (most recent call last):
File "/home/lizhihua/.local/lib/python3.8/site-packages/optlang/util.py", line 305, in getattr
return self._functions[item]0
KeyError: 'optimality'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lizhihua/.local/bin/smetana", line 89, in
main(
File "/home/lizhihua/.local/lib/python3.8/site-packages/smetana/interface.py", line 341, in main
entries, debug_entries = run_global(comm_id, community, organisms, medium_id, excluded_mets, env,
File "/home/lizhihua/.local/lib/python3.8/site-packages/smetana/interface.py", line 132, in run_global
mip, extras = mip_score(community, environment=env, verbose=verbose,
File "/home/lizhihua/.local/lib/python3.8/site-packages/smetana/smetana.py", line 257, in mip_score
noninteracting_medium, sol1 = minimal_medium(noninteracting.merged, exchange_reactions=exch_reactions,
File "/home/lizhihua/.local/lib/python3.8/site-packages/reframed/cobra/medium.py", line 50, in minimal_medium
solver = solver_instance(model)
File "/home/lizhihua/.local/lib/python3.8/site-packages/reframed/solvers/init.py", line 76, in solver_instance
return solverssolver
File "/home/lizhihua/.local/lib/python3.8/site-packages/reframed/solvers/optlang_solver.py", line 29, in init
Parameter.OPTIMALITY_TOL: self.problem.configuration.tolerances.optimality,
File "/home/lizhihua/.local/lib/python3.8/site-packages/optlang/util.py", line 307, in getattr
raise AttributeError(item + " is not an available tolerance parameter with this solver")
AttributeError: optimality is not an available tolerance parameter with this solver

Specifying compartment identifiers

Hi,
I am currently trying to run smetana on some genome-scale metabolic models constructed using ModelSEED.
I get an error when trying to run smetana through the command smetana *.xml, so I checked that my models are valid SBML files using the online SBML validator. My models are valid, but there seems to be a problem with the compartment identifiers. The warning from the validator says:

"As a principle of best modeling practice, the size of a should be set to a value rather than be left undefined. Doing so improves the portability of models between different simulation and analysis systems, and helps make it easier to detect potential errors in models. The with the id 'c0' does not have a 'size' attribute, nor is its initial value set by an or .

"

When I want to specify the identifier of the extracellular compartment in the models by including --ext e0 in my command, I get an error saying that the '--ext e0' argument is not recognized. Also, it doesn't say anything about it in the documentation, but is there a way to specify the identifier of the cytosol, too?

I think specifying the compartment identifiers could maybe help fixing the error I get when trying to run the program (?):
Traceback (most recent call last):
File "/home/laura/.local/bin/smetana", line 89, in
main(
File "/home/laura/.local/lib/python3.8/site-packages/smetana/interface.py", line 333, in main
comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
File "/home/laura/.local/lib/python3.8/site-packages/smetana/interface.py", line 333, in
comm_models = [model_cache.get_model(org_id, reset_id=True) for org_id in organisms]
File "/home/laura/.local/lib/python3.8/site-packages/reframed/io/cache.py", line 31, in get_model
model = load_cbmodel(self.paths[model_id], **self.load_args)
File "/home/laura/.local/lib/python3.8/site-packages/reframed/io/sbml.py", line 148, in load_cbmodel
load_metabolites(sbml_model, model, flavor, load_metadata)
File "/home/laura/.local/lib/python3.8/site-packages/reframed/io/sbml.py", line 220, in load_metabolites
model.add_metabolite(load_metabolite(species, flavor, load_metadata=load_metadata))
File "/home/laura/.local/lib/python3.8/site-packages/reframed/io/sbml.py", line 228, in load_metabolite
if fbc_species.isSetChemicalFormula():
AttributeError: 'NoneType' object has no attribute 'isSetChemicalFormula'

Thank you in advance! :)

Laura

Identifying minimal medium composition in detailed interactions

Hi Daniel,

I have a 4 species community for which I calculated 100 detailed interaction simulations using the --molweight flag. Now I am interested in getting an idea of the minimal media compostion used in detailed interactions, does it make sense to run a number of global simulations with the --debug flag and extract the media composition in the row associated with the MRO of the community?

community	medium	key1	key2	data
all	complete	mip	ni	ca2,cl,cobalt2,cu2,fe3,gam,k,mg2,mn2,nac,no,o2,pi,pnto__R,ribflv,so4,thm,val__L,zn2
all	complete	mip	i	ca2,cl,cobalt2,cu2,fe3,gam,k,mg2,mn2,nac,o2,pi,pnto__R,ribflv,so4,thm,zn2
all	complete	mro	community	ca2,cl,cobalt2,cu2,fe3,gam,k,mg2,mn2,nac,o2,pi,pnto__R,ribflv,so4,thm,zn2
all	complete	mro	CHCC10675	ca2,cl,cobalt2,cu2,fe3,glyc,k,mg2,mn2,nh4,pi,so4,thm,val__L,zn2
all	complete	mro	CHCC4895	ca2,cl,cobalt2,cu2,fe3,gam,k,mg2,mn2,nac,pi,pnto__R,ribflv,so4,thm,zn2
all	complete	mro	CHCC5614	ca2,cl,cobalt2,cu2,fe3,fol,gam,k,mg2,mn2,o2,pi,ribflv,so4,thm,val__L,zn2
all	complete	mro	CHCC6086	ca2,cl,cobalt2,cu2,fe2,gly,h,k,mg2,mn2,o2,pi,so4,thm,val__L,zn2

Thanks and best wishes,
Francisco

Segmentation fault

Running Smetana (master branch, commit d2b1043) with 4 models and with parameters --solver cplex -v --flavor bigg --detailed returns segmentation fault. Models were generated using carveme. Please let me know if I can help with debugging.

Output:

Loading community: all
Running SCS for community all on medium minimal...
Running MUS for community all on medium minimal...
Segmentation fault (core dumped) 

SCS and MPS from detailed analysis are always 1

Hi @cdanielmachado and thank you for providing SMETANA,

>>> import smetana
>>> smetana.__version__
'1.2.0'

I currently have pairs of interacting microbial genomes (predicted from another analysis). I wanted to use SMETANA on those pairs to see if they exhibit more putative exchanges than randoms pairs, and maybe dissect which kind of metabolites are involved.

What I did was run smetana --detailed independently on each pair of SBML, then concatenate the results into a list of putative interactions. I have several questions regarding this analysis.

  • Out of the 38k interactions that were predicted, I noticed that all the SCS and MPS scores were always 1 (only MUS changed, and thus SMETANA was always equal to MUS given how it's calculated). Is that something normal?
    image

  • I thought this might be related to the kind of medium that was used by default. I tried manually setting it to another medium provided by SMETANA, but I'm never able to get a solution whichever medium I use. Looking at the code, I understood that "minimal" in the result table wasn't referring to the minimal medium from mediadb, but that a custom minimal medium was build independently for each analysis (hence, for each pair), using a dependency from the reframed package. Could you describe what are the conditions applied to this minimal medium? Is there a way to recover it as an extra output of the analysis?

  • When I look at the list of compounds exchanged, I see that a lot of interactions are dummy elements that I would expect would be provided by the medium (h2o for instance). And for a significant part of those predicted interactions, the smetana score is very high (close to 1). The way I understood it, the smetana score should be usable to filter those kind of artifactual cross-feeding interactions. Do you have an idea about what could be happening?

Thank you in advance for your help.

Best regards,
−Nils

failing to find medium

To anyone having this problem, please use the flag "--flavor bigg" when running smetana.

The problem is the way the exchange reactions are calculated. If we know the models use BiGG identifiers we can assign all reactions that start with "R_EX_" as exchange reactions. Otherwise, it searches for all unbalanced reactions which can include internal "sink" reactions as well, and this creates an error when merging the individual species into community models.

I will try to fix this soon.

Cross-feeding interaction untraceable metabolites

Hi Daniel,

I generated my Smetana microbial community interactions, but I can not seem to find a logic in the exchanged metabolites. Is there any way to trace a metabolite production pathway in the donor organism?

I am verifying the BlastKoala-generated pathway of my donor organism, and I am looking at the metabolic model using Fluxer (https://fluxer.umbc.edu/).

For example, from the Smetana metabolic interactions, it appears that my donor organism is donating H2S, but I can not find a pathway for H2S production in the genome. By visualising the GEM with Fluxer I can see that H2S is needed (not produced) in the assimilatory sulfate reduction pathway to produce L-Cysteine.

So how is Smetana deducing that the metabolite is produced by the microorganism?
Any suggestions on how I can trace the Smetana production of the metabolites in the genome or GEM?

Thank you!
Best regards,
Iulia

Adjusting the non-CarveMe GEMs to SMETANA

Hi, I have a problem finding biomass when I simulate the model built with modelseed using smetana, have you tried how the modelseed model should be modified?

(py38) C:\Users\wupen>python C:\Users\wupen\Program\Anaconda3\envs\py38\Scripts\smetana D:\jupyternotebook\Y_YL_model\ac_final_WP1376_03.xml D:\jupyternotebook\Y_YL_model\st_process_atp_compart.xml -v -d --molweight --zeros --flavor cobra
Loading community: all
Traceback (most recent call last):
File "C:\Users\wupen\Program\Anaconda3\envs\py38\Scripts\smetana", line 89, in
main(
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\interface.py", line 338, in main
medium_id, env = define_environment(medium, media_db, community, mode, verbose, min_mol_weight, use_lp)
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\interface.py", line 118, in define_environment
env = minimal_environment(community, verbose=verbose, min_mol_weight=min_mol_weight, use_lp=use_lp,
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\smetana.py", line 373, in minimal_environment
exch_reactions = set(community.merged.get_exchange_reactions())
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\legacy.py", line 203, in merged
self._merged_model = self.generate_merged_model()
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\legacy.py", line 271, in generate_merged_model
models_missing_biomass = [m.id for m in self._organisms.values() if not m.biomass_reaction]
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\smetana\legacy.py", line 271, in
models_missing_biomass = [m.id for m in self._organisms.values() if not m.biomass_reaction]
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\reframed\core\cbmodel.py", line 190, in biomass_reaction
self._detect_biomass_reaction()
File "C:\Users\wupen\Program\Anaconda3\envs\py38\lib\site-packages\reframed\core\cbmodel.py", line 213, in _detect_biomass_reaction
raise RuntimeError(f"No biomass reaction identified from model objective.")
RuntimeError: No biomass reaction identified from model objective.

Empty detailed.tsv

I was executing some SMETANA runs and for every single one I noticed that there were no scores in the 'detailed.tsv'.... only the column headings. The GEMs I used were the ones output by CarveMe; both gap_filled and unfilled versions produced the blank detailed file.

Co-occurrent bacteria

Hi,
I would like to test which metabolites pathways are complemented (if there is) between two taxa that are highly co-occurrent and that have co-evolved.
I produced .xml with gapseq (I did not use any medium ref as these bacteria were never cultivated).
I then just run Smetana on the two .xml files with -d parameters.
Would you recommend this approach?
Thanks for you help&suggestion

Cheers,

Nico

CarveMe Models without Gap Filling for Smetana

Thank you for developing smetana!
I just have a general question. I'm currently building models with carveme by using the default command (carve genome.faa) without
specifying any media via --gapfill. I use these models then as input for smetana (smetana -g --flavor bigg), again without specifying any media with -m. My question is now, how reliable are the MRO and MIP metrics if I can not specify the media at all?

Different results and run time of detailed analysis

Hi Daniel,

I’m running SMETANA in --detailed mode to estimate inter-species interactions, and noticed that analyses ran on the same dataset return a different number of interactions and scores. Is this expected?

Also – I am trying to estimate interactions across groups of ca. 500 genomes, the analysis has been running for 3 days and is still in the “Running SCS” stage. Would excluding inorganic compounds help with runtime? Do you have any tips on how I could speed-up or parallelise the analyses?

Many thanks!!
Vanessa

Is it possible to generate the list of cross-fed metabolites between the pair of organism

I am using smetana to generate the cross fed metabolites.
Input Command
smetana Lactobacillus_paracasei_ATCC_334.xml V_harveyi_QT520.xml --mediadb constrained_media_comp.tsv --flavor cobra
Output
community medium size mip mro
all complete 2 n/a 0.7692307692307693

why is the mip score showing n/a?
Further in smetana is their anyway , the program will output the list or name of cross-fed metabolites.
Thank You!!

Originally posted by @NTDevika in #7 (comment)

Issues when running with a 10 member community

Hi,

When I use smetana with the detailed flag on my ten member community, it sometimes stops after 4 members and gives the following error for the rest of the members.

MUS: Failed to find a minimal growth medium for microbe_model
warn('MUS: Failed to find a minimal growth medium for ' + org_id)

However, it has also went through nine members before before throwing the error shown above.

Do you have suggestions as to the cause and recommendations on how I can get more consistent results?

Thank you!

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.