iquasere / reCOGnizer

A tool for domain based annotation with databases from the Conserved Domains Database
BSD 3-Clause "New" or "Revised" License
30 stars 2 forks source link

COG identifications issue #3

Closed gaworj closed 2 years ago

gaworj commented 2 years ago

Hi, Thank you very much for such amazing tool.

When I try to run recognizer for COG database I encounter such issue:

[1/1] Handling COG identifications grep -E 'K[0-9]{5}$' /media/jang/SSD2/recognizer_resources_dir/protein.info.v11.0.txt | awk '{{if (length($NF) == 6) print $1, $NF}}' awk '{if (length($4) == 7) print $1" "$4}' /media/jang/SSD2/recognizer_resources_dir/COG.mappings.v11.0.txt | sort | join - /media/jang/SSD2/recognizer_resources_dir/string2ko.tsv join: -:13109: is not sorted: 1001530.BACE01000023_gene1 COG5184 join: /media/jang/SSD2/recognizer_resources_dir/string2ko.tsv:61: is not sorted: 264203.ZMO1579 K06889 Traceback (most recent call last): File "/home/jang/anaconda3/envs/deepnog/bin/recognizer.py", line 461, in main() File "/home/jang/anaconda3/envs/deepnog/bin/recognizer.py", line 432, in main report = cog2ko(report, cog2ko=f'{args.resources_directory}/cog2ko.tsv') File "/home/jang/anaconda3/envs/deepnog/bin/recognizer.py", line 272, in cog2ko df[['COG', 'KO']].groupby('COG')['KO'].agg([('KO', ','.join)]).reset_index().to_csv( File "/home/jang/anaconda3/envs/deepnog/lib/python3.9/site-packages/pandas/core/generic.py", line 3466, in to_csv return DataFrameRenderer(formatter).to_csv( File "/home/jang/anaconda3/envs/deepnog/lib/python3.9/site-packages/pandas/io/formats/format.py", line 1105, in to_csv csv_formatter.save() File "/home/jang/anaconda3/envs/deepnog/lib/python3.9/site-packages/pandas/io/formats/csvs.py", line 237, in save with get_handle( File "/home/jang/anaconda3/envs/deepnog/lib/python3.9/site-packages/pandas/io/common.py", line 702, in get_handle handle = open( FileNotFoundError: [Errno 2] No such file or directory: 'f{directory}/cog2ko.tsv'

Any hints?

Bests, Jan

iquasere commented 2 years ago

Hi there!

And thank you for your interest in the tool! This is something that escaped the testings, and I will launch a new version tomorrow to fix it! In the mean time, if you want this fixed right away, you can edit the reCOGnizer script with some text editor, and change the line

            'f{directory}/cog2ko.tsv', sep='\t', index=False, header=['cog', 'KO'])

to

            f'{directory}/cog2ko.tsv', sep='\t', index=False, header=['cog', 'KO'])

This was a mistake on my part, and I am sorry for it. You can also run which recognizer.py to know which is the right file to edit!

gaworj commented 2 years ago

Hi! Brilliant! Now it works properly! COG assignment looks wonderful. I see COG numbers + categories. That's exactly what I wanted. Thank you very much!

Bests, Jan

iquasere commented 2 years ago

Glad to see it worked fine! Good luck on your work :)