-
Notifications
You must be signed in to change notification settings - Fork 62
Description
I am encountering a very specific python KeyError I have never encountered when running carveme before within the python scripts in the reframed package. For some context, I had previously used a conda/mamba installation of an older carveme version (I believe 1.5.4) and am now using a fresh installation of the newest version as of submitting this issue (1.6.4) due to file corruption of my prior installation. I have used carveme often in the past in the same linux environment and have never encountered this error previously.
To produce this error I'm using the fresh conda/mamba environment I've created precisely in the following way
mamba create --prefix <my-desired-env-path> -c bioconda carveme diamond
in keeping with the existing installation documentation. When I call my carve command in verbose mode on an amino acid fasta file from the OMD database (a file that I had previously run successfully in my prior installation)
carve -v -o test.xml -n 2 MARD_SAMN10141426_REFG_MMP10141426-prokka.faa
I receive the following standard output:
Running diamond...
diamond blastp -d /project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/carveme/data/generated/bigg_proteins.dmnd -q MARD_SAMN10141426_REFG_MMP10141426-prokka.faa -o MARD_SAMN10141426_REFG_MMP10141426-prokka.tsv --more-sensitive --top 10 --quiet
Loading universe model...
Scoring reactions...
at which point I encounter the same traceback of a fatal error (which I have replicated over multiple different amino acid fasta formatted data files):
Traceback (most recent call last):
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/bin/carve", line 10, in <module>
sys.exit(main())
~~~~^^
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/carveme/cli/carve.py", line 359, in main
maincall(
~~~~~~~~^
inputfile=args.input[0],
^^^^^^^^^^^^^^^^^^^^^^^^
...<19 lines>...
ref_score=args.reference_score
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/carveme/cli/carve.py", line 178, in maincall
gprs = gprs[gprs.reaction.isin(universe_model.reactions)]
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/pandas/core/series.py", line 5570, in isin
result = algorithms.isin(self._values, values)
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/pandas/core/algorithms.py", line 476, in isin
if not is_list_like(values):
~~~~~~~~~~~~^^^^^^^^
File "pandas/_libs/lib.pyx", line 1257, in pandas._libs.lib.is_list_like
File "pandas/_libs/lib.pyx", line 1275, in pandas._libs.lib.c_is_list_like
File "/project/nmherrer_110/tools/.conda/envs/CarveMe/lib/python3.13/site-packages/reframed/core/model.py", line 184, in __getattr__
return self[name]
~~~~^^^^^^
KeyError: 'ndim'
The traceback points ultimately to a KeyError mismatch in model.py within reframed. I have visually inspected the multiple fasta files I've attempted this with and see no evidence of deviation from the standard fasta format that would cause an issue. The DIAMOND step runs seamlessly and produces a non-empty .tsv formatted file with typical DIAMOND data output.
I'd love some guidance on this issue and I am happy to help in any way I can!