Skip to content

Adding local genome files to primary mtdb #16

@patrickbfungi

Description

@patrickbfungi

Hello, I am trying to create a mtdb that contains my local genome files (fa and gff3) along with those of 20 other taxa downloaded from NCBI. I got the mtdb with NCBI data set up. I also filled out the predb.tsv with my local genome info and converted it using predb2mtdb. Now, I am at the step where I am trying to add the local genome mtdb to the primary mtdb containing the NCBI genomes. I am using mtdb update -a and providing the path to the newly created mtdb with my local genome info.

I am getting the following errors:

Traceback (most recent call last):
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/frame.py", line 4911, in _set_value
self.mgr.column_setitem(icol, iindex, value, inplace_only=True)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/internals/managers.py", line 1518, in column_setitem
col_mgr.setitem_inplace(idx, value)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/internals/managers.py", line 2226, in setitem_inplace
arr[indexer] = value
~~~^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/arrays/string
.py", line 863, in setitem
value = self.maybe_convert_setitem_value(value)
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/arrays/string
.py", line 852, in _maybe_convert_setitem_value
if len(value) and not lib.is_string_array(value, skipna=True):
~~~^^^^^^^
TypeError: len() of unsized object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/patrickb/miniconda3/envs/mycotools/bin/update_mtdb", line 10, in
sys.exit(cli())
~~~^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/mycotools/update_mtdb.py", line 2221, in cli
main()
~~~~^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/mycotools/update_mtdb.py", line 2194, in main
control_flow(
~~~~~~~~~~~~^
args.init,
^^^^^^^^^^
...<18 lines>...
fallback=args.fallback,
^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/mycotools/update_mtdb.py", line 1866, in control_flow
orig_db = db2df(primaryDB())
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/mycotools/lib/dbtools.py", line 521, in db2df
db_df.at[i, "taxonomy"] = read_tax(row["taxonomy"])
~~~~~~~~^^^^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 2592, in setitem
return super().setitem(key, value)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 2542, in setitem
self.obj._set_value(*key, value=value, takeable=self._takeable)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/frame.py", line 4922, in _set_value
self.loc[index, col] = value
~~~~~~~~^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 938, in setitem
iloc._setitem_with_indexer(indexer, value, self.name)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 1953, in _setitem_with_indexer
self._setitem_with_indexer_split_path(indexer, value, name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 1974, in _setitem_with_indexer_split_path
value = self._align_series(indexer, Series(value))
File "/home/patrickb/miniconda3/envs/mycotools/lib/python3.14/site-packages/pandas/core/indexing.py", line 2455, in _align_series
raise ValueError("Incompatible indexer with Series")
ValueError: Incompatible indexer with Series

I am following your tutorial, but there is a possibility that I have made some sort of error along the way. Do any of these error messages make sense to you? I appreciate any guidance you can provide on this issue. Happy to provide more info if needed.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions