gbouras13 / pharokka

fast phage annotation program
MIT License
137 stars 13 forks source link

ValueError: invalid literal for int() with base 10: 'Traceback (most recent call last):\n File "/home/resistance/miniconda3/envs/pharokkaENV/bin/phanotate #332

Open yzhong005 opened 4 months ago

yzhong005 commented 4 months ago

Description

I am trying to do annotation for an assembled phage contig (single contig), runing the pharokka in pharokkaENV, installed with conda previously. I tried with/without -g prodigal, keep getting the same issue.

code I use

pharokka.py -g prodigal -d ~/phage_db -o ~/Data/annotation/test -f -i KSY1_b4_phage_contigs.fasta


Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```Traceback (most recent call last):
  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/pharokka.py", line 499, in <module>
    main()
  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/pharokka.py", line 143, in main
    ) = check_dependencies(args.skip_mash)
  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/input_commands.py", line 375, in check_dependencies
    phanotate_major_version = int(phanotate_version.split(".")[0])
ValueError: invalid literal for int() with base 10: 'Traceback (most recent call last):\n  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/phanotate
gbouras13 commented 4 months ago

Hi @yzhong005 ,

What is your version of Phanotate? e.g. trying phantotate.py -V

I suspect may be 1.6.4.

If so, please downgrade to 1.5.1 e.g.

mamba install phanotate==1.5.1

Someone put v1.6.4 on conda last week and it caused a lot of grief - I fixed the problem, but maybe you have 1.6.4 installed.

George

yzhong005 commented 4 months ago

Hi @gbouras13 Thank you so much for your fast reply! I tried ```phantotate.py -V showing error:


  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/phanotate.py", line 18, in <module>
    args = file_handling.get_args()
TypeError: get_args() missing 1 required positional argument: 'File'

###I also install phanotate with mamba

```mamba install phanotate==1.5.1
###look like everything is fine, but still get the same error when i try to check the version of phanotate
gbouras13 commented 4 months ago

Interesting - I am not sure what the issue is (though it is related to Phanotate I think!)

To be honest @yzhong005 , I would try a fresh install in a new environment (you won't have to redownload the database)

mamba create -n pharokkaENVnew pharokka
conda activate pharokkaENVnew

And try that out. If that doesn't work let me know!

George

yzhong005 commented 4 months ago

@gbouras13 Thank you so much! Unfortunately, I have re create the environment serval times, that why I put my database separately :( to avoid redownload. I re create the ENV just two minutes ago, still

Traceback (most recent call last):
  File "/home/resistance/miniconda3/envs/pharokkaENV/bin/phanotate.py", line 18, in <module>
    args = file_handling.get_args()
TypeError: get_args() missing 1 required positional argument: 'File'

Also, I use the -g prodigal, which supposedly should skip the phanotate :(...

gbouras13 commented 4 months ago

I will try and re-create the bug (there's some error with Phanotate!) - for now I would suggest going to

/home/resistance/miniconda3/envs/pharokkaENV/bin/input_commands.py

And manually removing

    #############
    # phanotate
    #############
    try:
        process = sp.Popen(
            ["phanotate.py", "--version"], stdout=sp.PIPE, stderr=sp.STDOUT
        )
    except:
        logger.error("Phanotate not found. Please reinstall pharokka.")
    phan_out, _ = process.communicate()
    phanotate_version = phan_out.decode().strip()
    phanotate_major_version = int(phanotate_version.split(".")[0])
    phanotate_minor_version = int(phanotate_version.split(".")[1])
    phanotate_minorest_version = phanotate_version.split(".")[2]

    logger.info(
        f"Phanotate version found is v{phanotate_major_version}.{phanotate_minor_version}.{phanotate_minorest_version}"
    )

    if phanotate_major_version < 1:
        logger.error("Phanotate is too old - please reinstall pharokka.")
    if phanotate_minor_version < 5:
        logger.error("Phanotate is too old - please reinstall pharokka.")

    logger.info("Phanotate version is ok.")

Instead, replace those lines with

phanotate_version="1.5.1"
yzhong005 commented 4 months ago

@gbouras13 Thank you so much! Fantastic! It works now! Even though don't know what happened to phanotate caused the error, I guess when the error fixed, I can retry with the new phanotate in the future. Thank you again!