Question: KaryoploteR for copy number
gravatar for rthapa
15 days ago by
rthapa0 wrote:


I am trying to plot a genome-wide Copy number variation using KaryoploteR. I am getting an error saying duplicate chromosome names in the genome. But I have CN in several locations of the same chromosome. Does anyone have any idea? Thanks

> head(custom.genome)
GRanges object with 6 ranges and 1 metadata column:
      seqnames        ranges strand |      CN
         <Rle>     <IRanges>  <Rle> | <numeric>
  [1]    Chr01   38005-43167      * |  1.999678
  [2]    Chr01   43335-46922      * |  1.415342
  [3]    Chr01   50386-50877      * |  1.398499
  [4]    Chr01   76659-79583      * |   2.41541
  [5]    Chr01 102003-104811      * |  1.357889
  [6]    Chr01 105542-109696      * |  1.629476

> plotKaryotype(genome = custom.genome)
Error in plotKaryotype(genome = custom.genome) : 
  There are duplicate chromosome names in the genome. Chromosome names must be unique. Chromosome names are: Chr01, Chr01, Chr01, Chr01
karyoploter genome • 127 views
ADD COMMENTlink modified 15 days ago by Philipp Bayer6.7k • written 15 days ago by rthapa0

I am not sure if you can specify the genome yourself. Did you follow some tutorial for this?

You may also want to add a tag for 'karyoplotr`; the author of the package is more likely to catch your post then.

EDIT: It would also help a lot if you could provide a sketch/description of the type of plot you're envisioning.

ADD REPLYlink modified 15 days ago • written 15 days ago by Friederike5.7k

Thank you for the advice. Here is the example of a plot I want to make. I didn't find a way to insert the image here.

The input file looks like,
Chr01   3647    4113    1.830792
Chr01   19860   23276   1.900404
Chr01   25267   27282   1.06339
Chr01   225962  226693  2.475208
ADD REPLYlink modified 14 days ago • written 14 days ago by rthapa0
gravatar for Philipp Bayer
15 days ago by
Philipp Bayer6.7k
Philipp Bayer6.7k wrote:

I think you switched up your variables, custom.genome needs the actual chromosome lengths and no other measurements, the table you have there needs to be given to kpPlotDensity(), not to plotKarytyope()

Have a look at this code I wrote a while ago which uses custom.genome too:

ADD COMMENTlink written 15 days ago by Philipp Bayer6.7k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 913 users visited in the last hour