Skip to contents

This demo draw chromosome ideogram with padding between chromosomes, highlights, chromosome names, and link lines.

#  Load RCircos library

library(RCircos);

#  Load human cytoband data and link data

data(RCircos.Link.Data);
data(UCSC.HG19.Human.CytoBandIdeogram);
cyto.info <- UCSC.HG19.Human.CytoBandIdeogram;

#  Setup RCircos core components:

RCircos.Set.Core.Components(cyto.info, NULL, 10, 0);
## 
## RCircos.Core.Components initialized.
## Type ?RCircos.Reset.Plot.Parameters to see how to modify the core components.
RCircos.Set.Plot.Area();


#  Draw chromosome ideogram

message("Draw chromosome ideogram ...\n");
## Draw chromosome ideogram ...
RCircos.Chromosome.Ideogram.Plot();
title("RCircos Link Plot Demo");

#  Link lines. Link data has paired chromosome 
#  locations only in each row and link lines 
#  are always drawn inside chromosome ideogram.

message("Add link track ...\n");
## Add link track ...
link.data <- RCircos.Link.Data;
link.colors <- rep("blue", nrow(link.data));
rows <- seq(1, nrow(link.data), by=5);
link.colors[rows] <- "red";
link.data["PlotColor"] <- link.colors;

track.num <- 2;
RCircos.Link.Plot(link.data, track.num, FALSE);

#  Close the graphic device and clear memory

message("RCircos Link Plot Demo Done!");
## RCircos Link Plot Demo Done!