Question: Making a circos plot to show expression for a gene set rather than whole genome
gravatar for Peter.Wood
3.9 years ago by
Peter.Wood0 wrote:


I am a new user to the OmicCircos package and the R code. For a little while I have been trying to create a circos plot to show the expression of a gene set. However, after constructing data frames with gene names and segment sizes, the segAnglePo and sim.circos functions consistently revert to the hg19/hg18 genome to form the anchor of the figure. If someone please explain how to construct an anchor for the circos plot using a set of genes rather than the entire human genome it would be much appreciated.

Kind regards,


ADD COMMENTlink modified 16 months ago by yifangt20 • written 3.9 years ago by Peter.Wood0
gravatar for Hu, Ying NIH/NCI [E]
3.8 years ago by
United States
Hu, Ying NIH/NCI [E]50 wrote:

You maybe wanted one gene on one segment. Please try the code as the following. 

The output file is at

NOTE: Please use the updated version


gene.n  <- 200;
chr     <- paste0("Gene", 1:gene.n);
val     <- rnorm(gene.n);
seg.dat <- data.frame(chr=chr, start=rep(1, gene.n), end=rep(1,gene.n)+1, name=chr, value=val);
seg.c   <- segAnglePo(seg.dat, seg=chr);

cols    <- rainbow(10, alpha=0.8);

pdf("BioC_support01.pdf", 8,8);
par(mar=c(2, 2, 2, 2))
plot(c(1,800), c(1,800), type="n", axes=FALSE, xlab="", ylab="");

circos(R=350, type="chr", cir=seg.c, print.chr.lab=TRUE, W=8)
circos(R=270, cir=seg.c, W=80, mapping=seg.dat, type="s", col.v=5, col=cols, B=T, cex=abs(seg.dat[,5])*1.5);
circos(R=190, cir=seg.c, W=80, mapping=seg.dat, type="b", col.v=5, col=cols, B=F, lwd=abs(seg.dat[,5])*1.5);
circos(R=110, cir=seg.c, W=80, mapping=seg.dat, type="b2", col.v=5, col=cols[c(1,7)], cutoff=0, B=T, lwd=2);;

ADD COMMENTlink written 3.8 years ago by Hu, Ying NIH/NCI [E]50

Hello Ying:

I had some difficulty to create a cir object with segAnglePo() function.

My dataframe is like this one, but I always got error as

> segAnglePo(seg.dat=seg.f,

Error in names(x) <- value :  'names' attribute [5] must be the same length as the vector [3]

Not sure what I missed, and I appreciate your advice on this issue.
Thanks a lot!

ADD REPLYlink written 16 months ago by yifangt20
gravatar for yifangt
16 months ago by
yifangt20 wrote:

Moved to comments

ADD COMMENTlink modified 16 months ago • written 16 months ago by yifangt20
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.2.0
Traffic: 208 users visited in the last hour