Question: Error in CNV Calling with Annotation
gravatar for wei.wei
4 weeks ago by
wei.wei10 wrote:

Hi, I was trying to call CNV in yeast genomes by running batch Sample1.bam Sample2.bam -n Control1.bam Control2.bam -m wgs -f sacCer.fasta --annotate refFlat.txt

command, but I ran into the error below:

Traceback (most recent call last):
  File "/Users/wwei/anaconda2/bin/", line 13, in <module>
  File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/", line 113, in _cmd_batch
    args.count_reads, args.method)
  File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/", line 74, in batch_make_reference
    bam_fname, *autobin_args, bp_per_bin=50000.)
  File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/", line 96, in do_autobin
    tgt_bin_size = depth2binsize(tgt_depth, target_min_size, target_max_size)
  File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/", line 62, in depth2binsize
    bin_size = int(round(bp_per_bin / depth))
    ValueError: cannot convert float NaN to integer

When I omit the --annotate option, it worked fine and I was able to obtain the .cnr and .cns files. Just wondering if anyone has ever encountered similar issues and if there's anything I could do about it. Thank you.

cnvkit • 126 views
ADD COMMENTlink modified 4 weeks ago by Eric T.2.4k • written 4 weeks ago by wei.wei10

Welcome to Biostars and thank you for the contribution! Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.

ADD REPLYlink written 4 weeks ago by RamRS20k
gravatar for Eric T.
4 weeks ago by
Eric T.2.4k
San Francisco, CA
Eric T.2.4k wrote:

Thanks for reporting, I've filed this issue in the project's GitHub repo:

It looks like the autobin step here ran into a NaN when doing some basic arithmetic with bin depths to estimate a reasonable average bin size. It's surprising that --annotate is responsible for the crash, as autobin shouldn't be doing anything with gene names.

Once you've determined a reasonable average bin size, do you still see the crash with batch ... --target-avg-size=<that-bin-size> --annotate?

ADD COMMENTlink written 4 weeks ago by Eric T.2.4k

Hi, thanks for the help. When I used --target-avg-size option it told me the real issue was that the chromosome names did not match in my input I was able to fix that. I don't know why it threw me a bin size error in the beginning.

ADD REPLYlink written 29 days ago by wei.wei10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1607 users visited in the last hour