marbl / canu

A single molecule sequence assembler for genomes large and small.
http://canu.readthedocs.io/
654 stars 179 forks source link

Illegal division by zero error in Meryl.pm #1488

Closed shenjean closed 4 years ago

shenjean commented 5 years ago

Hi,

I am trying canu again (default parameters) on a Linux pbs server and I keep getting this illegal division by zero error. I tried changing the minReadLength, minOverlapLength and correctedErrorRate but the error still persists.

Here is the log file:


-- Canu snapshot v1.8 +268 changes (r9478 b00a9c2f8c17b2273f1123eed3013a50252dc5b8)
--
-- CITATIONS
--
-- Koren S, Walenz BP, Berlin K, Miller JR, Phillippy AM.
-- Canu: scalable and accurate long-read assembly via adaptive k-mer weighting and repeat separation.
-- Genome Res. 2017 May;27(5):722-736.
-- http://doi.org/10.1101/gr.215087.116
-- 
-- Koren S, Rhie A, Walenz BP, Dilthey AT, Bickhart DM, Kingan SB, Hiendleder S, Williams JL, Smith TPL, Phillippy AM.
-- De novo assembly of haplotype-resolved genomes with trio binning.
-- Nat Biotechnol. 2018
-- https//doi.org/10.1038/nbt.4277
-- 
-- Read and contig alignments during correction, consensus and GFA building use:
--   Šošic M, Šikic M.
--   Edlib: a C/Câ++ library for fast, exact sequence alignment using edit distance.
--   Bioinformatics. 2017 May 1;33(9):1394-1395.
--   http://doi.org/10.1093/bioinformatics/btw753
-- 
-- Overlaps are generated using:
--   Berlin K, et al.
--   Assembling large genomes with single-molecule sequencing and locality-sensitive hashing.
--   Nat Biotechnol. 2015 Jun;33(6):623-30.
--   http://doi.org/10.1038/nbt.3238
-- 
--   Myers EW, et al.
--   A Whole-Genome Assembly of Drosophila.
--   Science. 2000 Mar 24;287(5461):2196-204.
--   http://doi.org/10.1126/science.287.5461.2196
-- 
-- Corrected read consensus sequences are generated using an algorithm derived from FALCON-sense:
--   Chin CS, et al.
--   Phased diploid genome assembly with single-molecule real-time sequencing.
--   Nat Methods. 2016 Dec;13(12):1050-1054.
--   http://doi.org/10.1038/nmeth.4035
-- 
-- Contig consensus sequences are generated using an algorithm derived from pbdagcon:
--   Chin CS, et al.
--   Nonhybrid, finished microbial genome assemblies from long-read SMRT sequencing data.
--   Nat Methods. 2013 Jun;10(6):563-9
--   http://doi.org/10.1038/nmeth.2474
-- 
-- CONFIGURE CANU
--
-- Detected Java(TM) Runtime Environment '1.8.0_212' (from 'java') with -d64 support.
-- Detected gnuplot version '4.6 patchlevel 2   ' (from 'gnuplot') and image format 'png'.
-- Detected 24 CPUs and 504 gigabytes of memory.
-- Detected PBSPro '19.1.1' with 'pbsnodes' binary in /opt/pbs/default/bin/pbsnodes.
-- Detecting PBSPro resources.
-- 
-- Found 328 hosts with   8 cores and   31 GB memory under PBSPro control.
-- Found  72 hosts with  16 cores and  125 GB memory under PBSPro control.
-- Found 270 hosts with  16 cores and   62 GB memory under PBSPro control.
-- Found  98 hosts with  24 cores and  125 GB memory under PBSPro control.
-- Found   1 host  with  40 cores and 1003 GB memory under PBSPro control.
-- Found  66 hosts with  24 cores and   47 GB memory under PBSPro control.
-- Found  16 hosts with   8 cores and   23 GB memory under PBSPro control.
-- Found 195 hosts with   8 cores and   11 GB memory under PBSPro control.
-- Found   4 hosts with  48 cores and  372 GB memory under PBSPro control.
-- Found 129 hosts with  40 cores and  372 GB memory under PBSPro control.
-- Found  10 hosts with  40 cores and  749 GB memory under PBSPro control.
-- Found   1 host  with  40 cores and 1511 GB memory under PBSPro control.
-- Found   6 hosts with  24 cores and  503 GB memory under PBSPro control.
-- Found 124 hosts with  20 cores and  125 GB memory under PBSPro control.
-- Found 648 hosts with   8 cores and   15 GB memory under PBSPro control.
-- Found  60 hosts with  28 cores and  125 GB memory under PBSPro control.
-- Found   1 host  with  64 cores and 2010 GB memory under PBSPro control.
-- Found   3 hosts with  80 cores and 1511 GB memory under PBSPro control.
--
--                     (tag)Threads
--            (tag)Memory         |
--        (tag)         |         |  algorithm
--        -------  ------  --------  -----------------------------
-- Grid:  meryl      5 GB    4 CPUs  (k-mer counting)
-- Grid:  hap        5 GB    4 CPUs  (read-to-haplotype assignment)
-- Grid:  cormhap    5 GB    4 CPUs  (overlap detection with mhap)
-- Grid:  obtovl     4 GB    4 CPUs  (overlap detection)
-- Grid:  utgovl     4 GB    4 CPUs  (overlap detection)
-- Grid:  cor        8 GB    4 CPUs  (read correction)
-- Grid:  ovb        4 GB    1 CPU   (overlap store bucketizer)
-- Grid:  ovs        8 GB    1 CPU   (overlap store sorting)
-- Grid:  red        5 GB    4 CPUs  (read error detection)
-- Grid:  oea        4 GB    1 CPU   (overlap error adjustment)
-- Grid:  bat       16 GB    4 CPUs  (contig construction with bogart)
-- Grid:  cns      --- GB    4 CPUs  (consensus)
-- Grid:  gfa       16 GB    4 CPUs  (GFA alignment and processing)
--
-- In '6321canu.seqStore', found PacBio reads:
--   Raw:        2135
--   Corrected:  0
--   Trimmed:    0
--
-- Generating assembly '6321canu' in '/pscratch/scratch1/jslim/ciona/6321canu'
--
-- Parameters:
--
--  genomeSize        4300000
--
--  Overlap Generation Limits:
--    corOvlErrorRate 0.2400 ( 24.00%)
--    obtOvlErrorRate 0.1050 ( 10.50%)
--    utgOvlErrorRate 0.1050 ( 10.50%)
--
--  Overlap Processing Limits:
--    corErrorRate    0.3000 ( 30.00%)
--    obtErrorRate    0.1050 ( 10.50%)
--    utgErrorRate    0.1050 ( 10.50%)
--    cnsErrorRate    0.1050 ( 10.50%)
--
--
-- BEGIN CORRECTION
--
-- Meryl finished successfully.  Kmer frequency histogram:
Illegal division by zero at /home/jslim/canu/Linux-amd64/bin/../lib/site_perl/canu/Meryl.pm line 200.
skoren commented 5 years ago

This usually happens when you have no k-mers. Are you sure the reads are OK? Either way the solution is to use a release, update to the 1.9 branch and recompile:

git checkout v1.9
rm -r Linux-amd64
make

remove any old folders and start from scratch.

skoren commented 4 years ago

Any update on this?

shenjean commented 4 years ago

Hi Sergey,

You can go ahead and close this thread. Thanks!

Jean

skoren commented 4 years ago

OK, feel free to post the resolution if any.