artic-network / civet

Cluster Investigation & Virus Epidemiology Tool
https://cov-lineages.org/resources/civet.html
GNU General Public License v3.0
48 stars 14 forks source link

Error when preparing background data following guideline #165

Closed genomesurveillance closed 1 year ago

genomesurveillance commented 1 year ago

Hello, civet developers, It might be something small, but I could not figure out the reason. When preparing the background data set following the guideline, with the following command: "civet -bd align_curate -bd-seqs hcov_europe.fasta -bd-metadata hcov_europe.tsv --sequence-id-column strain", I always got this error: AttributeError: 'str' object has no attribute 'name'".

Both the fasta and tsv files were downloaded from GISAID following the guideline of civet. The version of civet installed is 3.0.1. When testing with the command "civet --version" and "civet --art", all appear normal. I tried it with both linux system and macintosh system, and got the same error. I would really appreciate a quick solution for it.

aineniamh commented 1 year ago

Hi @genomesurveillance, if it's possible could you supply the whole error message and I'll look into what the source of the error is?

aineniamh commented 1 year ago

Having a look around it looks like it could be a snakemake version issue (https://github.com/spacegraphcats/spacegraphcats/issues/471).

What version of snakemake have you in the environment?

snakemake --version

genomesurveillance commented 1 year ago

The whole error message is: Traceback (most recent call last): File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/snakemake/init.py", line 699, in snakemake success = workflow.execute( File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/snakemake/workflow.py", line 1043, in execute logger.run_info("\n".join(dag.stats())) File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/snakemake/dag.py", line 2176, in stats yield tabulate(rows, headers="keys") File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/tabulate/init.py", line 2048, in tabulate list_of_lists, headers = _normalize_tabular_data( File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/tabulate/init.py", line 1471, in _normalize_tabular_data rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows)) File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/tabulate/init.py", line 1471, in rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows)) File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/tabulate/init.py", line 107, in _is_separating_line (len(row) >= 1 and row[0] == SEPARATING_LINE) File "/home/yibuq/anaconda3/envs/civet/lib/python3.9/site-packages/snakemake/rules.py", line 1127, in eq return self.name == other.name and self.output == other.output AttributeError: 'str' object has no attribute 'name'

genomesurveillance commented 1 year ago

The snakemake version in linux system is: 6.8.0.

genomesurveillance commented 1 year ago

Both the error report and snakemake version are the information in Linux system.

aineniamh commented 1 year ago

Ah, that error suggests it's a tabulate error. If you type in the civet environment pip uninstall tabulate and then type pip install tabulate==0.8.9 that should solve. I'll update the civet setup.py to specify a particular tabulate version.

genomesurveillance commented 1 year ago

Thanks a lot for the help! Now it works! Indeed it is caused by the version of tabulate.

genomesurveillance commented 1 year ago

Thank you for helping me solve this issue so quickly!

aineniamh commented 1 year ago

No worries, glad to hear it's working now! 🎉

ctb commented 1 year ago

thanks for linking to the spacegraphcats issue 😆 - suggested a structural fix to snakemake over here and you might go thumbs up that if it resonates!