ablab / viralVerify

viralVerify: viral contig verification tool
MIT License
65 stars 12 forks source link

Syntax Error in viralverify.py #10

Closed gabrielrfernandes closed 3 years ago

gabrielrfernandes commented 3 years ago

Running the viralverify.py script, I found this syntax Error

File "./viralverify.py", line 173
    open (f"{res_path}_virus.fasta", "a").close() 
                                  ^
SyntaxError: invalid syntax

These the packages in my environment:

packages in environment at ~/miniconda2/envs/viralverify:

Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
ca-certificates           2021.4.13            h06a4308_1  
certifi                   2020.12.5        py39h06a4308_0  
hmmer                     3.3.2                he1b5a44_0    bioconda
ld_impl_linux-64          2.33.1               h53a641e_7  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
ncurses                   6.2                  he6710b0_1  
openssl                   1.1.1k               h27cfd23_0  
pip                       21.1.1           py39h06a4308_0  
prodigal                  2.6.3                h516909a_2    bioconda
python                    3.9.5                hdb3f193_3  
readline                  8.1                  h27cfd23_0  
setuptools                52.0.0           py39h06a4308_0  
sqlite                    3.35.4               hdfb4753_0  
tk                        8.6.10               hbc83047_0  
tzdata                    2020f                h52ac0ba_0  
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
mikeraiko commented 3 years ago

Hello! Based on miniconda2 in your path, I suspect that you are using Python2.x. In the viralVerify code there are some features that appeared only in Python3, such as f-strings.

gabrielrfernandes commented 3 years ago

Hello! Thanks for answering so quick :) If you check the environment packages, we see the python version 3.9.5.

But, to test, I changed to miniconda3, and I still have the same error

# packages in environment at ~/miniconda3/envs/viralverify:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
ca-certificates           2021.4.13            h06a4308_1  
certifi                   2020.12.5        py39h06a4308_0  
hmmer                     3.3.2                he1b5a44_0    bioconda
ld_impl_linux-64          2.33.1               h53a641e_7  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
ncurses                   6.2                  he6710b0_1  
openssl                   1.1.1k               h27cfd23_0  
pip                       21.1.1           py39h06a4308_0  
prodigal                  2.6.3                h516909a_2    bioconda
python                    3.9.5                hdb3f193_3  
readline                  8.1                  h27cfd23_0  
setuptools                52.0.0           py39h06a4308_0  
sqlite                    3.35.4               hdfb4753_0  
tk                        8.6.10               hbc83047_0  
tzdata                    2020f                h52ac0ba_0  
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
mikeraiko commented 3 years ago

Well, maybe the problem was in shebang string - it was just updated it to #!/usr/bin/env python3, in order to work properly with environments, probably it will work now, please update and check.

gabrielrfernandes commented 3 years ago

Solved! Thanks