amillard / tax_myPHAGE

Workflow to assign Taxonomy to a bacteriophage genome isolate
MIT License
24 stars 2 forks source link

[BUG] Doesn't produce taxonomy - missing both a library and panda 3.0 issue #15

Open raw937 opened 3 months ago

raw937 commented 3 months ago

Describe the bug Appears to be both a pandas 3.0 issue and a missing library. It doesn't produce a taxonomy either way.

To Reproduce

taxmyphage -i UP30.fsa -o UP30_out -p UP30 -t 8
taxmyphage -i query.fasta -o out -p test -t 8

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

========================= TAXMYPHAGE version 0.3.1


Looking for database files

Found /home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/database/VMR.xlsx as expected /home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/handle_files.py:114: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method. The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

taxa_df["Genbank"].fillna("", inplace=True) Found /home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/database/ICTV_2023.msh as expected Found /home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/database/Bacteriophage_genomes.fasta.nhr as expected


Starting tax_my_phage analysis

Classifying: 0%| | 0/1 [00:00<?, ?it/s]

Classifying UP30 in result folder UP30_out/Results_per_genome/UP30


MASH analysis

Number of phage genomes detected with mash distance of < 0.2 is:1

The mash distances obtained for this query phage:

+-----++-----+ | Minimum || Maximum | +-----++-----+ | nan || nan | +-----++-----+

Found 0 genera associated with this query genome

Classifying: 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/docwhite/miniconda3/envs/taxmyphage/bin/taxmyphage", line 10, in sys.exit(main()) ^^^^^^ File "/home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/main.py", line 124, in main all_classification( File "/home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/actions.py", line 140, in all_classification mash_df, accession_genus_dict = classification_mash( ^^^^^^^^^^^^^^^^^^^^ File "/home/docwhite/miniconda3/envs/taxmyphage/lib/python3.12/site-packages/taxmyphage/classify.py", line 187, in classification_mash keys = [k for k, v in accession_genus_dict.items() if v == unique_genera[0]]


IndexError: list index out of range

**Please complete the following information:**

***OS:*** 

 - [X ] Linux
 - [ ] Windows
 - [ ] Mac

***taxmyPHAGE Version:***

   TAXMYPHAGE version 0.3.1

**Additional context**
From outfile
Reference,Query,distance,p-value,shared-hashes,ANI
mash: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory,,,,,

>query_UP30
ATGAGCAATACCAATCAGGAATTAAAAATCACCGATATGATTCGCCTAACCTGCGATGCA
ATGTACCGCGACAAAGGCATGAAAGAGTTCTCTTTCGTGGCTGATGATATGGCGAGAGAG
GCGGTAAAATTTTACTTCCGAGATCAGGATATTTCAGATGATGAGGTGGAGCGCGGAGCT
ACCGGGTGGGTGAACCAGAACCAGGGCGAGGTGGAGAAGCGATTCAAGTCGGCTTTCATC
ACCCCGATCATTACCCGACACTTCTGCAAGTATGGCAAGGTGGCAAAGGTTAAGGTAGGC
AGGAATGACGCAGCAATCACTATGATAACCGTTACCGTTACCGACGAAGAGGCTCCGGTG

query.fasta is from your website. 
tsp-kucbd commented 3 months ago

It looks like you have a problem with the GNU Scientific Library (GSL) shared library, so your mash command does not work, and therefore you don't get any hits.

If you try ldd $(which mash)

It should tell you that it is missing libgsl.so.25 If you installed mash via Conda, it should installed the correct version of libgsl too ... Maybe reinstall mash?

raw937 commented 3 months ago

I installed based on this command mamba create -n taxmyphage -c conda-forge -c bioconda taxmyphage mamba activate taxmyphage taxmyphage install

Which version of mash should be included? The pandas message isn't an issue?

Many thanks, Rick

amillard commented 3 months ago

It is version mash 2.3 The pandas warnings shouldnt stop it working

Andy

raw937 commented 3 months ago

installed mash. this library is missing -> libgsl.so.25 => not found

I tried sudo apt-get install libgsl-dev still couldn't find it.

thoughts?

tsp-kucbd commented 3 months ago

So, essentially your mash installation does not work. How did you install mash? If it is via conda, then the library dependencies should be seen to automatically. If you installed it by hand, you would need to double check that it is compiled against the correct library. One solution would be to compile mash on your computer ...

raw937 commented 3 months ago

Installed with conda - that worked. Don't know what this error is.

tsp-kucbd commented 3 months ago

Can you try the following commands? which mash ldd $(which mash) mash -h This should give you information of where to start.

raw937 commented 2 months ago

mash -h mash: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory

ldd $(which mash) linux-vdso.so.1 (0x00007cf5af48e000) libgsl.so.25 => not found libcblas.so.3 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/libcblas.so.3 (0x00007cf5ad000000) libstdc++.so.6 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/libstdc++.so.6 (0x00007cf5ace1d000) libz.so.1 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/libz.so.1 (0x00007cf5af39f000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007cf5af39a000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007cf5af393000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007cf5af2ac000) libgcc_s.so.1 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/libgcc_s.so.1 (0x00007cf5af28d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007cf5aca00000) /lib64/ld-linux-x86-64.so.2 (0x00007cf5af490000) libgfortran.so.5 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/./libgfortran.so.5 (0x00007cf5acc78000) libquadmath.so.0 => /home/docwhite/miniconda3/envs/taxmyphage/bin/../lib/././libquadmath.so.0 (0x00007cf5af253000)

sandraaran commented 2 months ago

Hi, I’m encountering the same problem when running the program using the Dockerfile from your repository. Do you have a solution for the "IndexError: list index out of range"? I updated Mash and other programs via the Dockerfile, but the problem still persists.

The error is : File "/opt/conda/lib/python3.12/site-packages/taxmyphage/main.py", line 124, in main all_classification( File "/opt/conda/lib/python3.12/site-packages/taxmyphage/actions.py", line 140, in all_classification mash_df, accession_genus_dict = classification_mash( ^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.12/site-packages/taxmyphage/classify.py", line 187, in classification_mash keys = [k for k, v in accession_genus_dict.items() if v == unique_genera[0]]


IndexError: list index out of range
rdenise commented 1 month ago

Hi @sandraaran, the Dockerfile was never tested and might not work sorry