merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
426 stars 145 forks source link

Issues on my way though the anvio pangenomics tutorial #1231

Closed kevin-lab closed 4 years ago

kevin-lab commented 5 years ago

Hi ANVIO Team,

I m currently working my way though the anvio(5.5.0) pangenomics tutorial and I m acrossed two seperate issues:

1.) We dont know what exactly the issue is, its not listing the available keys within profile.db

Afterwards we deleted one of the keys (category1) and this worked fine.

anvi-delete-misc-data -p profile.db --target-data-table items --list-available-keys

DATA KEYS FOR "ITEMS" in 1 DATA GROUP(S)
===============================================

* DATA GROUP "default" WITH 7 KEYS
Traceback (most recent call last):
  File "/home/kevin/miniconda3/envs/anvio5/bin/anvi-delete-misc-data", line 53, in <module>
    main(args)
  File "/home/kevin/miniconda3/envs/anvio5/bin/anvi-delete-misc-data", line 30, in main
    table_for_additional_data.list_data_keys()
  File "/home/kevin/.local/lib/python3.6/site-packages/anvio/tables/miscdata.py", line 255, in list_data_keys
    rows = database.get_some_rows_from_table_as_dict(self.table_name, 'data_key="%s"' % data_key)
  File "/home/kevin/.local/lib/python3.6/site-packages/anvio/db.py", line 461, in get_some_rows_from_table_as_dict
    rows = self._exec('''SELECT * FROM %s WHERE %s''' % (table_name, where_clause)).fetchall()
  File "/home/kevin/.local/lib/python3.6/site-packages/anvio/db.py", line 205, in _exec
    ret_val = self.cursor.execute(sql_query)
sqlite3.OperationalError: near "bars_main": syntax error

2.) We faced the problem twice, the files provided for the tutorial are no longer compatable with the current version of anvio. As shown below, the example data uses the old format for providing information which can not be recognized.

For the first file with this, we converted the “;” into tabs and provided new column names. Perhaps that caused the first error but we are not sure.

anvi-import-misc-data layers_additional_data.txt \
>                          -p profile.db \
>                          --target-data-table layers

Config Error: Oh no :( We recently changed the description of the stacked bar data type, and  
              your input data file still has the older version. Here is the list of those that
              are violating the new format: "stacked_bar!X;Y;Z". To avoid this issue and to   
              turn them into the new format, you could take 'stacked_bar!X;Y;Z', and present  
              it as 3 separate TAB-delimited entries that look like this: "stacked_bar!X",    
              "stacked_bar!Y", "stacked_bar!Z". Sorry!        

Thanks for any help you can provide and for the great tool.

meren commented 4 years ago

Hi @kevin-lab, apologies for the late response and out-of-date documentation on interactive interface data types.

We have relatively recently changed the bar type and clearly didn't change things in the online documentation. I will take a look.

meren commented 4 years ago

Wait. Everything seems to work in the pangenomics tutorial. Can you tell me how did you obtain the file that gives you near "bars_main": syntax error?

we converted the “;” into tabs and provided new column names. Perhaps that caused the first error but we are not sure

How they should look like is explained here:

http://merenlab.org/2016/02/27/the-anvio-interactive-interface/#15-stacked-bars

Best,

kevin-lab commented 4 years ago

Found the issue, turns out that the quotation marks caused the issue.

Thanks for your help.