jodyphelan / TBProfiler

Profiling tool for Mycobacterium tuberculosis to detect ressistance and strain type from WGS data
GNU General Public License v3.0
102 stars 42 forks source link

v6.2.0 fails to import tbdb (whov2) #339

Closed abhi18av closed 2 months ago

abhi18av commented 3 months ago

Hi @jodyphelan ,

I noticed that there was a bugfix in v6.2.0 and I tested this release regarding the use of WHOv2 directly.

The problem seems to be stemming from the pathogenprofiler dependency 🤔

For some reason, the v6.0.0 works fine on conda ✅ and biocontainer ✅


~ 🅒 tb-profiler-env
+  p$ tb-profiler --version
tb-profiler version 6.0.0

+  p$ tb-profiler update_tbdb --commit 22e9ceb6433d02071222af8dca506c6348604877 --logging DEBUG
[13:53:26] DEBUG    Running command: git clone https://github.com/jodyphelan/tbdb.git                                        utils.py:489
[13:53:28] DEBUG    Running command: git checkout master                                                                     utils.py:489
[13:53:29] DEBUG    Running command: git pull                                                                                utils.py:489
           DEBUG    Running command: git checkout 22e9ceb6433d02071222af8dca506c6348604877                                   utils.py:489
           DEBUG    Running command: tb-profiler create_db --prefix tbdb --csv mutations.csv --watchlist watchlist.csv       utils.py:489
                    --rules rules.txt --load
[13:53:30] DEBUG    Removing temporary files: 8198346a-a17c-4f9f-9a61-fdca995076b8                                            utils.py:29
           INFO     Sucessfully updated TBDB                                                                              tb-profiler:218
~ 🅒 tb-profiler-env
+  p$ micromamba install tb-profiler=6.2.0

                                           __
          __  ______ ___  ____ _____ ___  / /_  ____ _
         / / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
        / /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
       / .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
      /_/

gurobi/noarch                                      130.0 B @ 159.0 B/s  0.9s
gurobi/osx-64                                        4.6kB @   4.6kB/s  1.0s
bioconda/osx-64                                      4.4MB @   3.7MB/s  1.3s
pkgs/r/noarch                                                 No change
pkgs/r/osx-64                                                 No change
bioconda/noarch                                      5.2MB @   2.7MB/s  1.2s
pkgs/main/noarch                                   861.6kB @ 398.7kB/s  0.3s
conda-forge/noarch                                  16.3MB @   7.4MB/s  2.5s
pkgs/main/osx-64                                     6.4MB @   1.6MB/s  2.8s
conda-forge/osx-64                                  34.8MB @   7.3MB/s  5.7s

Pinned packages:
  - python 3.10.*

Transaction

  Prefix: /Users/abhi/.micromamba/envs/tb-profiler-env

  Updating specs:

   - tb-profiler=6.2.0

  Package              Version  Build         Channel             Size
────────────────────────────────────────────────────────────────────────
  Upgrade:
────────────────────────────────────────────────────────────────────────

  - pathogen-profiler    4.0.0  pyh7cba7a3_0  bioconda            57kB
  + pathogen-profiler    4.1.0  pyh7cba7a3_0  bioconda/noarch     57kB
  - tb-profiler          6.0.0  pyhdfd78af_0  bioconda             9MB
  + tb-profiler          6.2.0  pyhdfd78af_0  bioconda/noarch      9MB

  Summary:

  Upgrade: 2 packages

  Total download: 9MB

────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] Y

Transaction starting
pathogen-profiler                                   57.5kB @ 340.0kB/s  0.2s
tb-profiler                                          8.9MB @  13.9MB/s  0.6s
Changing pathogen-profiler-4.0.0-pyh7cba7a3_0 ==> pathogen-profiler-4.1.0-pyh7cba7a3_0
Changing tb-profiler-6.0.0-pyhdfd78af_0 ==> tb-profiler-6.2.0-pyhdfd78af_0

Transaction finished

To activate this environment, use:

    $ [micro]mamba activate <environment>

Or to execute a single command in this environment, use:

    $ [micro]mamba run -n <environment> mycommand
~ 🅒 tb-profiler-env
+  p$ tb-profiler update_tbdb --commit 22e9ceb6433d02071222af8dca506c6348604877 --logging DEBUG
[14:06:50] DEBUG    Running command: git checkout tbdb                                                                       utils.py:480
           DEBUG    Running command: git pull                                                                                utils.py:480
[14:06:51] DEBUG    Running command: git checkout 22e9ceb6433d02071222af8dca506c6348604877                                   utils.py:480
           DEBUG    Running command: tb-profiler create_db --prefix tbdb --csv mutations.csv --watchlist watchlist.csv       utils.py:480
                    --rules rules.txt --load
[14:06:52] ERROR                                                                                                             utils.py:485
           DEBUG    Removing temporary files: 2dff4499-3481-4d9a-94d6-746a4f09a2ed                                            utils.py:32
Traceback (most recent call last):
  File "/Users/abhi/.micromamba/envs/tb-profiler-env/bin/tb-profiler", line 583, in <module>
    args.func(args)
  File "/Users/abhi/.micromamba/envs/tb-profiler-env/bin/tb-profiler", line 211, in main_update_tbdb
    pp.run_cmd(f"tb-profiler create_db --prefix {args.prefix} --csv mutations.csv --watchlist watchlist.csv {extra_args} --load")
  File "/Users/abhi/.micromamba/envs/tb-profiler-env/lib/python3.10/site-packages/pathogenprofiler/utils.py", line 486, in run_cmd
    raise ValueError("Command Failed:\n%s\nstderr:\n%s" % (cmd,result.stderr.decode()))
ValueError: Command Failed:
/bin/bash -c set -o pipefail; tb-profiler create_db --prefix tbdb --csv mutations.csv --watchlist watchlist.csv --rules rules.txt --load
stderr:

Cleaning up after failed run
           ERROR                                                                                                           tb-profiler:59

                    ################################# ERROR #######################################

                    This run has failed. Please check all arguments and make sure all input files
                    exist. If no solution is found, please open up an issue at
                    https://github.com/jodyphelan/TBProfiler/issues/new and paste or attach the
                    contents of the error log (tbdb.errlog.txt)

                    ###############################################################################

~ 🅒 tb-profiler-env
+  p$
abhi18av commented 2 months ago

Hi @jodyphelan , could you please let us know when is the next patch release scheduled?

abhi18av commented 2 months ago

Closing this issue as this has been address with https://github.com/jodyphelan/tbdb/commit/bdace1f82d948ce0001e1dade6eb93d2da9c47e5

Thanks Jody!