Hi, I have been using CNVkit for 3 months now and discovering few interesting things.
These are my questions:
1) How can plot copy number segments of paired tumor and normal samples on the same scatter plot? Something like this

2) I have done Segmentation and Segment Calling. Applied the default threshold values (-t=-1.1,-0.4,0.3,0.7) at the 'Call' step. But the number of Copy number positions did not change with the applied threshold. For example, My .segments.cns file had 100 CNV positions with the applied threshold, there should be a decrease in the number. But that didn't happen!! Am I doing something wrong??
3) How can use -t (threshold) at segmentation step? Does it need 4 threshold values like the call step?
I'd really appreciate if someone could answer my questions.
Thank you!
1 answer
- This feature isn't available on the command line, currently. It would be a nice feature, and you're not the first to request it. I've opened a ticket for it here: https://github.com/etal/cnvkit/issues/353
However, within the Python interpreter or in a script you can use cnvlib.do_scatter to generate a plot with one segment set, and then use matplotlib functions and/or functions within cnvlib.scatter and cnvlib.plots to add another set of horizontal spans to the same matplotlib axis object.
To merge segments with the same inferred integer copy number, you can use
cnvkit.py call --filter cn. Otherwise, the segment breakpoints are left alone and each segment is assigned an integer copy number (cnvalue, in the .cns file) independently. See here: https://cnvkit.readthedocs.io/en/stable/pipeline.html#filtering-segmentsIt counts up by ploidy: the first threshold value specifies the cutoff between cn=0 and cn=1, the second specifies cn=1 vs. cn=2, etc. And beyond the specified cutoffs, for higher copy numbers, it defaults to the cutoffs that would be implied for log2 values in a fully clonal/germline/single-cell diploid sample.
Log in to answer this question.