pyani icon indicating copy to clipboard operation
pyani copied to clipboard

ValueError: zero-size array to reduction operation minimum which has no identity

Open neelam19051 opened this issue 2 years ago • 9 comments

Summary: Hi, I am trying to run pyani but it gives some error in description.

ValueError: zero-size array to reduction operation minimum which has no identity

Description:

**average_nucleotide_identity.py -i /home/neel@m95/Desktop/AMR/ref/fna -o /home/neel@m95/Desktop/AMR/ref/output -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

pyani Version:

pyani-0.2.11

installed dependencies

If you are running a version of pyani v0.3 or later, then please run the command pyani listdeps at the command line, and enter the output below. conda install -c bioconda pyani

Python Version: 3.6

Operating System: Ubuntu 18.04 LTS

neelam19051 avatar Jan 12 '22 14:01 neelam19051

Hi @neelam19051

Thank you for your interest in pyani - that's an error I've not seen before. It looks to me as though there has been an issue with the analysis. Would you please be able to attach a minimal input dataset to this issue, so we can investigate?

Many thanks,

L.

widdowquinn avatar Jan 13 '22 18:01 widdowquinn

I have also run into this exact error and I am curious if any resolution was found. I am using nearly 200 genomes of ~50 kbp each, and if preferred I will open my own question rather than post here.

jthomp28 avatar Mar 10 '22 16:03 jthomp28

Thanks @jthomp28 - do you have a minimal dataset that would allow us to reproduce this and investigate?

L.

widdowquinn avatar Mar 10 '22 16:03 widdowquinn

@widdowquinn Thanks for the quick response! I do have one ready, what would be the best method to get this to you? I am new to GitHub apologies.

jthomp28 avatar Mar 10 '22 17:03 jthomp28

If it's small enough, you can upload it here - makes things nice and neat for reproduction/follow-up.

widdowquinn avatar Mar 10 '22 17:03 widdowquinn

TheloniousMonk.txt Thor.txt Topgun.txt Traft412.txt Treddle.txt Tripl3t.txt Trouble.txt Turj99.txt U2.txt Violet.txt Watermelon.txt Wheeler.txt Wilkins.txt Zeeculate.txt Zephyr.txt Zeuska.txt Abbyshoes.txt Abrogate.txt Acme.txt Adahisdi.txt Aeneas.txt AFIS.txt Ajay.txt Alsfro.txt Alvin.txt Anglerfish.txt Arcanine.txt Arlo.txt Atkinbua.txt BaconJack.txt Barriga.txt Beatrix.txt BeesKnees.txt Bethlehem.txt Bexan.txt Big3.txt Bigfoot.txt BigMau.txt BigPaolini.txt BillKnuckles.txt Bircsak.txt Blue.txt Bob3.txt Bones.txt BPBiebs31.txt Briton15.txt Bruns.txt Burton.txt Buttons.txt Bxb1.txt CactusRose.txt Carlyle.txt ConceptII.txt Corvo.txt Crispicous1.txt Cueylyss.txt DD5.txt Doom.txt Dreamboat.txt DreamCatcher.txt DrFeelGood.txt Dulcie.txt Dussy.txt Dynamix.txt Edtherson.txt Euphoria.txt Fajezeel.txt Fascinus.txt Fenn.txt Forsytheast.txt Francis47.txt Froghopper.txt Fushigi.txt GageAP.txt Gandalf20.txt Gompeii16.txt Graduation.txt Greg.txt Gyzlar.txt HanShotFirst.txt HarryOW.txt HermioneGrange.txt Homines.txt Hope4ever.txt Ichabod.txt ILeeKay.txt JackSparrow.txt Jasper.txt JC27.txt Jerm2.txt Jorgensen.txt Kanely.txt KBG.txt Kenmech.txt Killigrew.txt KSSJEB.txt Kugel.txt Kykar.txt KyMonks1A.txt Lamina13.txt Lesedi.txt Licorice.txt Lockley.txt Lopton.txt Magnar.txt Magnito.txt Makemake.txt Manatee.txt Marcell.txt Marge.txt Maroc7.txt Marsha.txt MaryBeth.txt McGuire.txt MetalQZJ.txt Michley.txt Moose.txt MPlant7149.txt MrGordo.txt Mryolo.txt Mule.txt Museum.txt Naira.txt NEHalo.txt Nerujay.txt Nhonho.txt Niza.txt Ohno789.txt Oogway.txt PacerPaul.txt Papez.txt Paphu.txt Pari.txt Parliament.txt PattyP.txt Pepe.txt Perseus.txt Petp2012.txt Petruchio.txt PherrisBueller.txt PhrostyMug.txt PinkPlastic.txt Pinto.txt Pippin.txt Pita2.txt PSullivan.txt Rajelicia.txt Rhynn.txt RidgeCB.txt Ringer.txt Rohr.txt Rubeus.txt Rufus.txt Ruotula.txt Rutherferd.txt Sagefire.txt SarFire.txt Scowl.txt Seabiscuit.txt Seanderson.txt Sibs6.txt SkiPole.txt Smairt.txt Smeagol.txt Snazzy.txt Solon.txt SpikeBT.txt Squee.txt STLscum.txt StrongArm.txt Sumter.txt Sunshine924.txt SwissCheese.txt Switzer.txt Target.txt Tasp14.txt


Above I have attached all the files used in my analysis as they were small enough to include, apologies if it is more than needed. Below is the script I used to run pyANI:

average_nucleotide_identity.py -v -i /home/jthomp28/scratch/mycothesis/All_Sequences/A1Phages -o /home/jthomp28/scratch/mycothesis/All_Sequences/pyANI_results/A1pyANI -m ANIm -g

I am also running this on a cluster and the rest of the script is below if that is relevant.


#!/bin/bash #SBATCH --account=def-emandevi #SBATCH --time=6-00:00:00 #SBATCH --nodes=4 #SBATCH --ntasks-per-node=48 #SBATCH --mem=0 #CEDAR

module load python module load mummer #used by pyani for quick genome alignment

module load StdEnv/2020 module load gcc/9.3.0 module load blast+

virtualenv --no-download $SLURM_TMPDIR/anaconda source $SLURM_TMPDIR/anaconda/bin/activate

pip install --no-index --upgrade pip pip install --no-index -r requirements.txt

pip3 install pyani #no 3rd party tools, installed above

Thank you so much for your time, I genuinely appreciate it!

jthomp28 avatar Mar 10 '22 19:03 jthomp28

It's going to take me ages to click on all those. Can you isolate a minimal handful of files/a command I can run to reproduce the problem, or maybe provide those files you've linked in a .zip file or similar, please?

widdowquinn avatar Mar 10 '22 20:03 widdowquinn

A1Phages_txt.zip

@widdowquinn Apologies for that, I don't know why I didn't compress them previously. Here are all the text files in a zip file. Again, thank you.

jthomp28 avatar Mar 10 '22 20:03 jthomp28

@widdowquinn, this may be useful in future for downloading files attached to issues:

https://gist.github.com/baileythegreen/df61c39b39c5f04772a39af2968a118a

I haven't done much to generalise it (yet), but it at least worked for me to be able to download all of these files.

baileythegreen avatar Mar 11 '22 14:03 baileythegreen