CNVnator histogram error
3
0
Entering edit mode
8.4 years ago

Has anyone seen this error with CNVnator and knows a work-around?

Calculating histograms with bin size of 100 for 'chr18' ...
Making GC histogram for 'chr18' ...
Sequence length (78077249) is different from expectation (78077248) for 'chr18'.

This is after running

./../src/cnvnator -root out.root -genome hg19.fa -chrom chr18 chr21 -tree file.bam
./../src/cnvnator -root out.root -genome hg19.fa -chrom chr18 chr21 -his 10

Thanks for any help!

cnvnator • 3.7k views
ADD COMMENT
0
Entering edit mode

Hello, I also encounter the same problem that sequence length is different from expectation by 1 when I run cnvnator. The command is ./cnvnator -root out.root -chrom 1 -his 100.

Here is the output: Allocating memory ... Done. Calculating histograms with bin size of 100 for '1' ... Making GC histogram for '1' ... Sequence length (249250622) is different from expectation (249250621) for '1'. Doing nothing! Done.

I have tried several methods, like setting file format to unix, using several ways to split whole bam file by chromosome and then convert each bam to .fa file. But all methods failed.

ADD REPLY
1
Entering edit mode
8.4 years ago

The length of chromosome 18 is 78077248 but in your input you have a region ending in 78077249.

Do use a bed format at some point? It seems that you are using 1 based system instead of a 0 based system.

If the data is in bed format, subtract 1 from the end positions.

If the input data is in BAM format, the dirty and not recommended quick fix is to edit the SAM header and increase length of chromosomes by 1.

ADD COMMENT
0
Entering edit mode

Hi, thanks for the response. Adjusting the sam header unfortunately doesn't fix the problem tho.

I only use bam files as input. Is bed an option?

ADD REPLY
0
Entering edit mode

It is weird if you get the exact same error after adjusting the chromosome size in sam headers.

Apparently no bed. You may want to try the fix here if something is weird with your bam file:

https://github.com/abyzovlab/CNVnator/issues/12

and if this doesn't work, I would post it in their github issues.

ADD REPLY
0
Entering edit mode
7.1 years ago

It's been more than a year I don't know whether you have found a solution or not... but I had the same problem.

In my case, I generated my reference sequence (your hg19.fa) from a Windows computer and tried to perform CNVnator on a Linux computer. And CNVnator kept telling me reference length was +1 longer than expected. No matter how I changed the header in my SAM file.

To solve the problem, all I need to do is to convert the reference.fa file from CR+LF (DOS/Windows) to LF (Unix). Go to gvim with reference.fa file open, enter ":set ff=unix". You should see your document change from "dos" into "unix" at the bottom of the gvim window. After I did this, CNVnator had no more error.

I hope this help.

ADD COMMENT
0
Entering edit mode
22 months ago
John Wick • 0

hello,I try to use the http://hgdownload.soe.ucsc.edu/goldenPath/hg19/chromosomes/chr1.fa.gz rather than the sequence that I cut in local refrence genome,maybe this can help

ADD COMMENT

Login before adding your answer.

Traffic: 1515 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6