Hi all,

I need some help with understanding the output of CNVkit, specifically Segmented log2 ratios (.cns) and the exported CNVs in VCF format.

I'm looking to get the copy number of every region found by CNVkit.

For Segmented log2 ratios (.cns) file:

Please correct me if i'm wrong: To get the actual estimated copy number I should simply anti-log the log2 column, right?

In that case,

 - What's the correlation/connection, if there is any, between the log2 value in the .cns file and the inferred SVLEN value in the .vcf file?

 - Is there any connection to the "CN" (copy number genotype...) value in the .vcf? Also, why does "CN" only appears in duplication events?  I tried calculating the copy number from the log2 value in the .cns file but the values are different than what I expected.

**An example if it helps:**

For a certain region in the .cns file, the log2 value is 0.382191.  
In the .vcf file, SVLEN is 6812878 and the CN value is 3. What is the copy number then?

Thanks,  
Alon
For segmented log2 ratios -- nearly. See the documentation for CNVkit's [call][1] command. But the easiest way to get the integer copy number values is through the "export" command, either VCF or BED.

 - I recommend ["export bed"][1] for custom analysis. If you are analyzing tumor samples with some known amount of normal-cell contamination, use "call" or "rescale" first to adjust the log2 ratios for that contamination.
 - The ["export vcf"] output conforms to the VCF spec, which is a little unintuitive for describing CNVs. The CN field means absolute copy number, but it's only specified for copy number gains, while hemizygous or homozygous deletions are specified differently, as you're seeing.

In your example, a log2 value of .38 corresponds to `2^(.38) = 1.3` times the reference ploidy. For a diploid genome, the absolute copy number would be `2 * 2^(.38) = 2.6`, which you can probably round up to 3 assuming some reasonable level of normal-cell contamination. (See the documentation on [tumor heterogeneity][4] for more guidance on this topic.)

 [1]: http://cnvkit.readthedocs.org/en/latest/pipeline.html#call
 [2]: http://cnvkit.readthedocs.org/en/latest/importexport.html#bed
 [3]: http://cnvkit.readthedocs.org/en/latest/importexport.html#vcf
 [4]: http://cnvkit.readthedocs.org/en/latest/heterogeneity.html