Plotting the X chromosome using the zoom function
1
0
Entering edit mode
9.8 years ago
Peter.Wood • 0

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", col.bar=F, 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.

Thanks.

OmicCircos gene-set-enrichment gene-expression • 2.9k views
ADD COMMENT
0
Entering edit mode
9.7 years ago
yhu ▴ 50

Please have a look at the code (The output file is at https://www.dropbox.com/s/qyo3oupjzwqs3ka/BioStars01.pdf?dl=0):

rm(list=ls());
library(OmicCircos);

data("UCSC.mm9.chr");
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);

dev.off();
ADD COMMENT

Login before adding your answer.

Traffic: 1838 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6