RCollins13 / CNView

Visualization and annotation of CNVs from population-scale whole-genome sequencing data
MIT License
69 stars 11 forks source link

Plot method error #8

Closed yipukangda closed 6 years ago

yipukangda commented 6 years ago

hi,

I tried as instruction as blow:

./CNView.R 2 178714141 178760307 b \
                 ./cnv_cov.bed \
                 ./CNView.pdf \
                 --title "CNV test"

Input bed file is like:

Chr Start   End a   b   c   d   r   f   g
1   2686797 2686925 213 248.52984923873572  298.49108457398745  270.76076337060414  214.8493604403114   253.3372704296603   131.24125452501843
1   11075575    11075708    170 190.18857544632164  208.06706210533318  171.7408143453303   228.94278128727456  177.234747100007    144.2659310232722

but ended with error:

Loading required package: optparse
+-------------------+
| CNView Visualizer |
|     (c) 2017      |
+-------------------+
Sample ID file 'b' not found, assuming single sample ID provided
Loading required package: RMySQL
Loading required package: DBI
Loading required package: methods
Loading required package: plyr
Loading required package: MASS
Loading required package: metap
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:plyr’:

    rename

The following object is masked from ‘package:base’:

    expand.grid

Loading required package: IRanges

Attaching package: ‘IRanges’

The following object is masked from ‘package:plyr’:

    desc

Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector

Attaching package: ‘XVector’

The following object is masked from ‘package:plyr’:

    compact

Attaching package: ‘Biostrings’

The following object is masked from ‘package:base’:

    strsplit

Filtering & loading coverage matrix... Complete
Compressing coverage matrix [1,281 bp bins]...  Complete
Performing intra-sample normalization... Complete
Performing inter-sample normalization... Complete
Plotting samples to /home/wxq/ftp/files/CNView.ExamplePlotA.pdf...Error in x[j] : invalid subscript type 'list'
Calls: CNView -> pt -> [ -> [.data.frame
Execution halted

Could you please tell me where the problem is. thanks

RCollins13 commented 6 years ago

Hi @yipukangda,

It appears that your input coverage bed file is incorrectly formatted. CNView requires uniform binned coverage data for all samples around (and including) the CNV of interest.

If your CNVs listed above were discovered from whole-genome sequencing, you'll need to first generate binned coverage of your chromosomes of interest before CNView visualization.

For instructions on how to generate this data, please see the documentation, available here.

In short, you're looking for your input file to resemble something like this (note the regularly spaced 100bp intervals):

Chr  Start     End       SampleA  SampleB  SampleC  ...  SampleZ
1    0         100       89       56       217      ...  141
1    100       200       98       60       230      ...  132
1    200       300       102      59       202      ...  142
...  ...       ...       ...      ...      ...      ...  ...
Y    59373200  59373300  79       48       207      ...  133
Y    59373300  59373400  89       51       196      ...  138
Y    59373400  59373500  93       68       198      ...  129

Ryan

yipukangda commented 6 years ago

Hi @RCollins13 , The CNVs list is generated from WES bams by target bed file , as you said, if I deposit bed intervals to be uniform binned first, the new bed file, however, will not fit for calculate target coverage, so could the CNView handle this situation? Thanks.

Kangda

RCollins13 commented 6 years ago

Hi @yipukangda,

Unfortunately, CNView doesn't currently support whole-exome sequencing data, but that is a feature that would be great to add at some point in the future.

Ryan

yipukangda commented 6 years ago

Hi @RCollins13

I solved the problem by merging the exome coverage with genome bed file, and generated the plot even though it looked a little weird.

Thanks again for your help.

RCollins13 commented 6 years ago

Great, glad to hear you found a suitable workaround. Always happy to help.

Best, Ryan