Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMETANA error: smetana.py:104, Failed to find a solution for growth of ' + org_id #111

Closed
White-Shinobi opened this issue Nov 14, 2022 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@White-Shinobi
Copy link

Dear Francisco,

I'm a PhD student from University of Groningen, focusing on host-gut microbiome interaction in HIV infection.
Recently, I am trying to use MetaGEM to answer my study hypothesis 🐬.
Thank you for building MetaGEM, which is a super brilliant work😊.

May I ask some questions about the logics inside SMETANA?

  1. For many samples, I would get the logs saying
    "Running SCS for community all on medium MEU8...
    Running MUS for community all on medium MEU8...
    /home/umcg-yzhang/.local/lib/python3.8/site-packages/smetana/smetana.py:104: UserWarning: SCS: Failed to find a solution for growth of X1218_G03_0462.100
    warn('SCS: Failed to find a solution for growth of ' + org_id)"
    (X1218_G03_0462.100 is the name for my bacterial bin)
    In my understanding, this is saying my medium can not make the bacteria species grow.
    Is there any way to get the minimal medium to fix this problem?

Best,
Yue

@franciscozorrilla
Copy link
Owner

franciscozorrilla commented Nov 14, 2022

Dear Yue,

Indeed this is suggesting that your species X1218_G03_0462.100 is unable to grow in that medium. Could this perhaps be a low quality/incomplete MAG? Pehaps you may need to perform additional/manual gapfilling for this model, or alternatively simply omit this model from your community analysis if possible.

In order to identify the minimal media of a given community try running the following command. In my case, I have a model called bacteria.xml and another called yeast.xml, so my minimal_debug.tsv file looks like this:

$ smetana --molweight -v -g -o minimal --debug path/to/models/*.xml

$ paste minimal_debug.tsv 
community	medium	key1	key2	data
all	complete	mip	ni	ala_B,ca2,cl,cobalt2,cu2,dha,fe2,fe3,ile__L,k,mg2,mn2,o2,orn,pi,so4,thm,tyr__L,val__L,zn2
all	complete	mip	i	ca2,cl,cobalt2,cu2,dha,fe2,fe3,k,mg2,mn2,o2,orn,pi,so4,thm,val__L,zn2
all	complete	mro	community	ca2,cl,cobalt2,cu2,fe2,fe3,glyc3p,k,mg2,mn2,o2,orn,so4,thm,val__L,zn2
all	complete	mro	bacteria	ca2,cl,cobalt2,cu2,fe2,glyc3p,k,mg2,mn2,nh4,o2,pnto__R,so4,thm,val__L,zn2
all	complete	mro	yeast	ca2,cl,cobalt2,cu2,dha,fe2,fe3,ile__L,k,mg2,mn2,o2,orn,pi,so4,thm,tyr__L,val__L,zn2

The data columm specifies a possible minimal media composition for each species in your community, as well as for the community. Note that these are not unique minimal media solutions, the --molweight flag additionally minimizes the molecular weight of the minimal media composition predicted, as this tends to produce more realistic media.

In the example above, if I were trying to find a minimal media for the bacteria I would take the media predicted above, but for example replace the carbon source glyc3p to reflect the carbon in your media, etc. Then you need to put this in the format of CarveMe/SMETANA media files, as shown here for example.

medium description compound name
M1 M1 3mb 3mb
M1 M1 4abz 4abz
M1 M1 ac ac
M1 M1 btn btn
M1 M1 but but
M1 M1 ca2 ca2
M1 M1 cbl1 cbl1
M1 M1 cbl2 cbl2
M1 M1 cellb cellb
M1 M1 cl cl
M1 M1 cobalt2 cobalt2
M1 M1 cu2 cu2
M1 M1 cys__L cys__L
M1 M1 fe2 fe2
M1 M1 fe3 fe3
M1 M1 fol fol
M1 M1 fru fru
M1 M1 glc__D glc__D
M1 M1 h h

Below is an example bash command that you can use in order to extract a media composition from the minimal_debug.tsv file. In this case, I chose to extract out the bacteria media into column form, which can be pasted into an excel sheet and completed to the spceifications shown above.

$ paste minimal_debug.tsv|grep bacteria|cut -f5|tr ',' '\n'
ca2
cl
cobalt2
cu2
fe2
glyc3p
k
mg2
mn2
nh4
o2
pnto__R
so4
thm
val__L
zn2

Best wishes,
Francisco

@franciscozorrilla franciscozorrilla self-assigned this Nov 14, 2022
@franciscozorrilla franciscozorrilla added the question Further information is requested label Nov 14, 2022
@White-Shinobi
Copy link
Author

White-Shinobi commented Nov 16, 2022 via email

@White-Shinobi
Copy link
Author

White-Shinobi commented Nov 16, 2022 via email

@White-Shinobi
Copy link
Author

Hi Francisco,

When I tried the smetana --debug command, I also had the same issue with this question👇
MRO: Failed to find a valid solution

But this problem only appears when I ran all the 30 GEMs together, it didn't show error when I only run on xml file.

Best,
Yue

@franciscozorrilla
Copy link
Owner

Hi Yue,

But what I don't understand is how the medium data is used to calculate the
sc_score?

https://github.com/cdanielmachado/smetana/blob/d2b10434df6d13741614420b933b0870ea598222/smetana/smetana.py#L11-L27

The species coupling score is calculated under a given media composition, as you can see in the definition it contains the Environment parameter.

Specific errors:
And in the log file, among all 30 bins, 2 bins show the error of "SCS:
Failed to find a solution for growth of binX; **warn('SCS: Failed to find a
solution for growth of ' + org_id)
"; however,* all 30 bins* show the error
of "MUS: Failed to find a minimal growth medium for BinX; warn('MUS:
Failed to find a minimal growth medium for ' + org_id)
".

Have you seen this post on the CarveMe issues section? Perhaps try adding the --flavor bigg parameter to your SMETANA commands to see if it resolves the issue.

*Why are these 30 samples are empty? Do they show the same error as mine? *Do
you think it's a good idea to get the minimal medium for these bins in
these samples and re-run SMETANA for these samples?

Indeed we had some empty SMETANA results, as I discussed in this comment. Some of the empty samples were due to prohibitively long runtimes due to large community size, while others were due to small communities not predicted to require any metabolite exchanges. Yes, perhaps try running in a more complete or different media

When I tried the smetana --debug command, I also had the same issue with this question👇
cdanielmachado/smetana#28

I suggest you add a comment to that issue and ask iulia if she ever figured it out, perhaps also describing a bit your specific case.

But this problem only appears when I ran all the 30 GEMs together, it didn't show error when I only run on xml file.

Interesting ... thanks for sharing this. Do you know what the taxonomy of your two bins that are failing? Are they perhaps super fragmented genomes? Can you check the number of reactions and metaboites in those models?

Best,
Francisco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants