cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
145 stars 49 forks source link

Problems when building model ensembles in 1.5.0: AttributeError: 'NoneType' object has no attribute 'genes' #129

Closed filrot closed 3 years ago

filrot commented 3 years ago

Hi Daniel,

I am having issues when trying to build model ensembles with carveme 1.5.0.

It works fine for a single model, and I am able to build model ensembles when downgrading to 1.4.1.

When running carve genome.faa --fbc2 -n 2 -o model_2.xml it seems to get along fine:

...
Total time = 4.818s
Reported 23189 pairwise alignments, 23189 HSPs.
6240 queries aligned.

but then:

Traceback (most recent call last):
  File "path_to\miniconda3\envs\carveme\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "path_to\miniconda3\envs\carveme\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "path_to\Miniconda3\envs\carveme\Scripts\carve.exe\__main__.py", line 7, in <module>
  File "path_to\miniconda3\envs\carveme\lib\site-packages\carveme\cli\carve.py", line 370, in main
    ref_score=args.reference_score
  File "path_to\miniconda3\envs\carveme\lib\site-packages\carveme\cli\carve.py", line 214, in maincall
    annotate_genes(ensemble, gene2gene, gene_annotations)
  File "path_to\miniconda3\envs\carveme\lib\site-packages\carveme\reconstruction\utils.py", line 168, in annotate_genes
    if g_id not in model.genes:
AttributeError: 'NoneType' object has no attribute 'genes'

Do you have any suggestions?

Thank you for any help regarding this

filrot commented 3 years ago

We found a solution to the problem, and now buildiung ensembles works for me. #130

cdanielmachado commented 3 years ago

Sorry for not having time to reply earlier, and thank you for fixing the code!