karyoploteR icon indicating copy to clipboard operation
karyoploteR copied to clipboard

genome-wide visualization of copy number variation with karyoploteR

Open rthapa1 opened this issue 5 years ago • 5 comments

Hi,

I am new to karyoploteR. I want to visualize CNV data. I have an input file with a genomic location and copy number. I wonder what input file format is acceptable for karyoploteR.

Thanks

rthapa1 avatar May 12 '20 19:05 rthapa1

Hi @rthapa1

You can visualize CNV data with karyoploteR using any "bed-like" file as an input file or actually anything you can convert into a GRanges in R.

However, @miriammagallon and I have developed a package called CopyNumberPlots for that specific role. It can understand and read the output of many different CNV calling tools and generate plots of the LRR (real or simulated) signals, BAF signals (from SNP-array) and CNV callings. In addition, it can build a simulated BAF track from a standard VCF file.

You can find the package in the CopyNumberPlots bioconductor page and more information in the vignette.

bernatgel avatar May 13 '20 15:05 bernatgel

Thank you for the reply. I wonder if it is possible to plot Copy number data of non-human species with CopyNumberPlots. I tried with CopyNumberPlots package for the plant species but the plot appeared like of human. Do you have any suggestion on how could I manipulate the plot? Thanks Screen Shot 2020-06-16 at 1 44 53 PM

rthapa1 avatar Jun 16 '20 17:06 rthapa1

Hi @rthapa1

Yes, sure, you can plot on any genome with CopyNumberPlots.

To do that you need to build a custom genome (for example, a bed-like file with one line per chromosome with the chromosome sizes) and use it as the genome in plotKaryotype

kp <- plotKaryotype(genome=toGRanges("my_genome.txt"))

where my_genome.txt is something like

1 1 230002002 2 1 214728374 3 1 182839281

etc...

Does it make sense?

You can check the karyoploteR tutorial for more information (https://bernatgel.github.io/karyoploter_tutorial//Tutorial/CustomGenomes/CustomGenomes.html)

bernatgel avatar Jun 16 '20 22:06 bernatgel

Hi Bernat,

Thank you for the explanation. In my genome.txt file, I have many copy numbers in multiple location of the same chromosome but it looks like duplicate chromosome numbers are not allowed in the file. My file looks something like this,

CHROM START END CN
Chr01 3647 4113 1.830792
Chr01 19860 23276 1.900404
Chr01 25267 27282 1.06339
Chr01 225962 226693 2.475208

Do you have any suggestions on how to manipulate the format? I checked the tutorial but couldn't find the way. I will really appreciate your suggestion.

head(custom.genome) GRanges object with 6 ranges and 1 metadata column: seqnames ranges strand | CN <Rle> <IRanges> <Rle> | [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> head(custom.genome) GRanges object with 6 ranges and 1 metadata column: seqnames ranges strand | CN <Rle> <IRanges> <Rle> | [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

Thanks a lot

rthapa1 avatar Jun 17 '20 02:06 rthapa1

Hi Bernat,

I got the way to customize the genome. I am wondering if there is a way to customize the color of copy number in genome e.g. <1.5 CN as red color, 1.5-2.5 as blue color and >2.5 as green color.

Thanks

rthapa1 avatar Jun 17 '20 20:06 rthapa1