Skip to contents

This demo draw chromosome ideogram with padding between chromosomes, highlights, chromosome names, and line plot.

#  Load RCircos library

    library(RCircos);

#  Load human cytoband data and line plot data

data(RCircos.Line.Data);
RCircos.Line.Data$chromosome <- paste0("chr", 
      RCircos.Line.Data$chromosome);

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 Line Plot Demo");

#  Plot lines

line.data <- RCircos.Line.Data;
line.colors <- rep("blue", nrow(line.data))
rows <- which(abs(line.data$seg.mean)>=1.5);
line.colors[rows] <- "red";
line.data["PlotColor"] <- line.colors;

data.col <- 5; 
track.num <- 1;
direction <- "in";
RCircos.Line.Plot(line.data, data.col, track.num, "in");

#  Close the graphic device and clear memory

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