Question: Plotting the X chromosome using the zoom function
gravatar for Peter.Wood
5.4 years ago by
Peter.Wood0 wrote:

Using the zoom function in OmicCircos, I am trying to plot the gene expression for the  X chromosome.

#insert chromosome X
zoom <- c(X, X, 939245.5, 154143883, 343.7, 376.7);
# insert circos
circos(R=350, cir="hg19", W=4,   type="chr", print.chr.lab=T, scale=T, zoom=zoom);
circos(R=120, cir="hg19", W=263, mapping=gene.sample,  col.v=4,  type="heatmap2",, lwd=1, zoom=zoom);
circos(R=370, cir="hg18", W=15,  mapping=gene.sample, type="label", side="out", col="black", zoom=zoom);

But I am getting the error:

Error in chr1:chr2 : argument of length 0.

I would be grateful if someone could explain why this is only happening for the X chromosome and not for chromosomes 1-22.




ADD COMMENTlink modified 5.3 years ago by yhu50 • written 5.4 years ago by Peter.Wood0
gravatar for yhu
5.3 years ago by
United States
yhu50 wrote:

Please have a look at the code (The output file is at


chrX.i <- which(UCSC.mm9.chr[,1]=="chrX");
chrX   <- UCSC.mm9.chr[chrX.i,];

## segment data of chromosome X
seg.c   <- segAnglePo(chrX, seg="chrX");

gene.n  <- 200; 
po      <- sample(1:max(chrX[,2]), gene.n)
val     <- rnorm(gene.n);
map.d   <- data.frame(chr=rep("chrX", gene.n), po=po, value=val);

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

pdf("BioStars01.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="chr2", cir=seg.c, mapping=chrX, print.chr.lab=TRUE, W=4, scale=T);
circos(R=270, cir=seg.c, W=80, mapping=map.d, type="s", col.v=3, col=cols, B=T, cex=abs(map.d[,3])*1.5);
circos(R=190, cir=seg.c, W=80, mapping=map.d, type="b", col.v=3, col=cols, B=F, lwd=abs(map.d[,3])*1.5);
circos(R=110, cir=seg.c, W=80, mapping=map.d, type="b2", col.v=3, col=cols[c(1,7)], cutoff=0, B=T, lwd=2);;

ADD COMMENTlink written 5.3 years ago by yhu50
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: 1267 users visited in the last hour