cnvkit
cnvkit copied to clipboard
Error in WGS mode on yeast genome
From Biostars: https://www.biostars.org/p/364267/
(User) was trying to call CNV in yeast genomes by running
cnvkit.py batch Sample1.bam Sample2.bam -n Control1.bam Control2.bam -m wgs -f sacCer.fasta --annotate refFlat.txt
command, but ran into the error below:
Traceback (most recent call last):
File "/Users/wwei/anaconda2/bin/cnvkit.py", line 13, in <module>
args.func(args)
File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/commands.py", line 113, in _cmd_batch
args.count_reads, args.method)
File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/batch.py", line 74, in batch_make_reference
bam_fname, *autobin_args, bp_per_bin=50000.)
File "/Users/wwei/anaconda2/lib/python2.7/site-packages/cnvlib/autobin.py", 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/autobin.py", 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.
I encountered a similar error however it was due to the chromosome names of the BAM file not matching the chromosome names in the reference fasta used to generate the accessibility file (e.g. "chr1" vs "1"), and I no longer encountered the error after switching to the correct reference and chromosome naming.
I just encountered the same error when working on the human genome.