CNView
CNView copied to clipboard
Cnv view calls issue
Hello @RCollins13 ,
Thank you for great work, I am trying to use this to plot CNV for bam generated from 10x longranger wgs pipeline
Using following steps, I take a random deletion start and end co ordinate from bedpe file (for trial run) and
Step1) bedtools makewindows -b breakpoints.bed -n 100 -i winnum > windows.bed
Step2) bedtools coverage -a windows.bed -b sample.bam > coverage.bed
And this is my output, (I just use first 4 columns for CNView) 21 36696996 36706838 80 1799 9842 9842 1.0000000 21 36037582 36047424 13 1366 9842 9842 1.0000000 21 36175370 36185212 27 1252 9842 9842 1.0000000 21 36303316 36313158 40 1278 9842 9842 1.0000000 21 36431262 36441104 53 1699 9842 9842 1.0000000 21 36569050 36578892 67 1510 9842 9842 1.0000000 21 36824942 36834784 93 1566 9842 9842 1.0000000 21 35929320 35939162 2 1581 9842 9842 1.0000000 21 35939162 35949004 3 1579 9842 9842 1.0000000 21 35958846 35968688 5 1581 9842 9842 1.0000000
modify for CNV (trial_1.bed) Chr Start End SampleA 21 36696996 36706838 80 21 36037582 36047424 13 21 36175370 36185212 27 21 36303316 36313158 40 21 36431262 36441104 53 21 36569050 36578892 67 21 36824942 36834784 93 21 35929320 35939162 2 21 35939162 35949004 3
Rscript CNView.R 21 35919400 36903600 SampleA trial_1.bed sampleAexampleplot.pdf --title "exampleplot"
error:
+-------------------+ | CNView Visualizer | | (c) 2016 | +-------------------+ Sample ID file 'SampleA' not found, assuming single sample ID provided Filtering & loading coverage matrix... Complete Compressing coverage matrix [29,526 bp bins]... Error in apply(df[, 4:ncol(df)], 2, function(vals, compression) { : dim(X) must have a positive length Calls: CNView -> rebin -> apply Execution halted
not sure where am i am going wrong ...
Thanks. Frank
Hi @frankbioinfo,
Thanks for posting some example data and the error message. I hope I can help you out here.
CNView requires a coverage matrix of regularly-sized intervals that extend well beyond (recommended at least ±5Mb) the coordinates of the CNV you wish to plot. Typically, this is done with 100bp intervals. It looks like you've computed 9,842bp bins, which is ok, although I'd recommend dicing up those intervals into 100bp bins.
You will also want to extend this coverage matrix beyond the boundaries of the CNVs. An example of what this input should look like is available here: https://github.com/RCollins13/CNView#getting-started
Give this a shot and let me know if you still run into issues.
Best, Ryan