rjchallis / assembly-stats

Assembly statistic visualisation
http://genomehubs.org
MIT License
88 stars 83 forks source link

Illegal division by zero at ./asm2stats.minmaxgc.pl line 131 #8

Closed hsiaoyi0504 closed 6 years ago

hsiaoyi0504 commented 6 years ago

I got Illegal division by zero at ./asm2stats.minmaxgc.pl line 131 when trying to run asm2stats.minmaxgc.pl on data of this two files:

https://i5k.nal.usda.gov/data/Arthropoda/nicves-(Nicrophorus_vespilloides)/Current%20Genome%20Assembly/1.Genome%20Assembly/GCF_001412225.1/Scaffolds/GCF_001412225.1_Nicves_v1.0_genomic_RefSeqIDs.fna.gz

https://i5k.nal.usda.gov/data/Arthropoda/tricas-(Tribolium_castaneum)/Current%20Genome%20Assembly/1.Genome%20Assembly/Tcas5.2-GCF_000002335.3/Scaffolds/GCF_000002335.3_Tcas5.2_genomic_RefSeqIDs.fna.gz

I just look into the file, I think the problem maybe due to the mixed lowercase and uppercase of the fasta file. Can you update the perl script for that ? Sorry, I want to help but doesn't so familiar with perl....

hsiaoyi0504 commented 6 years ago

The file also can be fetched from https://ftp.ncbi.nlm.nih.gov/, so I think it should be supported.

rjchallis commented 6 years ago

Thanks for the report. This happens when the script encounters a section that has been scaffolded with a very long run of Ns so the GC content of the section is 0. It's a bug that came up when using code based on this script elsewhere as we mostly generate the json files as part of the genomehubs.org import, but I forgot to fix it in this repository. I've copied the bugfix across so it should process those files without errors now.

hsiaoyi0504 commented 6 years ago

It seems that some files work originally, don't work now. I got this error message

Modification of non-creatable array value attempted, subscript -1 at ./asm2stats.minmaxgc.pl line 21, <> line 1.

when dealing with this file

Upate 3: [solved]

I just forget I have some customized in original script......fixed now.

Update 2:

I test on another machine. It fails too. It seems that this script doesn't work on linux.


Update 1:

I find that it works on my local machine but doesn't work on my server, so maybe it's not problem of script, but if you have any idea about what's going on of my server, it would be great.

hsiaoyi0504 commented 6 years ago

Fixed in commit rjchallis@85759e7.