This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ValueError: zero-size array to reduction operation minimum which has no identity

Hi; I am trying to run pyani for ANI calculation and it provide some errors;

average_nucleotide_identity.py -i /home/neel@m95/Desktop/AMR/ref/fna/ -o output2 -m ANIm -g

Traceback (most recent call last): File "/home/neel@m95/.local/bin/average_nucleotide_identity.py", line 977, in <module> draw(methods[args.method][1], gfmt) File "/home/neel@m95/.local/bin/average_nucleotide_identity.py", line 800, in draw params_mpl(df)[filestem], File "/home/neel@m95/.local/lib/python3.6/site-packages/pyani/pyani_config.py", line 109, in params_mpl return {'ANIb_alignment_lengths': ('afmhot', df.values.min(), File "/home/neel@m95/.local/lib/python3.6/site-packages/numpy/core/_methods.py", line 43, in _amin return umr_minimum(a, axis, None, out, keepdims, initial, where) ValueError: zero-size array to reduction operation minimum which has no identity

Thank you!

pyani

1 answer

Hello Neel, Did you find out the solution for the error mentioned above? I got the same error. I ran it on a test folder it worked fine, however, for my real dataset it threw me an error. I made sure that none of my fasta files is empty. Any help is appreciated.

Update: I found out the 'enter' in the fasta files is the reason for this error. Removal of 'enter' fixed the problem. However, I don't want to remove it manually for each file so if you find out a solution for this please do let me know. Thanks in advance.

Don't know if that is what caused the problem above, but I cringe seeing @ in directory name.

If the program works with test data and your fasta files are not empty, it is likely something in your directory structure, naming, or how you are formulating a command. I suggest you start a new post and explain exactly what your command is and show the resulting error.

@Mensur Dlakic, thanks for the quick response. I tried it again making sure my files are in the correct format and it worked fine. I guess there was some problem when I tried to extract the virus fasta files from the metagenome which was making the pyani throw an error.

Log in to answer this question.