OmicCircos - Error in 1:scale.n : NA/NaN argument
0
0
Entering edit mode
@stefan-langenberg-12599
Last seen 7.8 years ago

Dear all,

I am trying to use package OmicCircos to create a circular genome plot. However, I am getting some strange results, I can not explain: some data at the end are displayed in the wrong segment. To find evidence if this error is caused by the data or by an error in package OmicCircos, I am trying to create a circos-plot with a subset of the data, where the error occurs:

library(OmicCircos)


library(OmicCircos)

seg.f <-
structurelistseg.name = c("17", "17", "17", "17", "17", "17", 
"17", "17", "17", "17", "17", "18", "18", "18", "18", "18", "18", 
"18", "18", "18", "18", "18", "19", "19", "19", "19", "20", "21", 
"22", "22", "23", "24", "25", "26", "27"), seg.Start = c(0L, 
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 0L, 1L, 2L, 3L, 4L, 
5L, 6L, 7L, 8L, 9L, 10L, 0L, 1L, 2L, 3L, 0L, 0L, 0L, 1L, 0L, 
0L, 0L, 0L, 0L), seg.End = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 
9L, 10L, 11L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 1L, 
2L, 3L, 4L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L), the.v = c(NA, 
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA), NO = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA, NA, NA, NA, NA, NA)), .Names = c("seg.name", "seg.Start", 
"seg.End", "the.v", "NO"), row.names = c(NA, 35L), class = "data.frame")

seg.v <-
structurelistseg.name = c("17", "17", "17", "17", "17", "17", 
"17", "17", "17", "17", "17", "18", "18", "18", "18", "18", "18", 
"18", "18", "18", "18", "18", "19", "19", "19", "19", "20", "21", 
"22", "22", "23", "24", "25", "26", "27"), seg.po = c(1L, 2L, 
3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 1L, 2L, 3L, 4L, 5L, 6L, 
7L, 8L, 9L, 10L, 11L, 1L, 2L, 3L, 4L, 1L, 1L, 1L, 2L, 1L, 1L, 
1L, 1L, 1L)), .Names = c("seg.name", "seg.po"), row.names = c(NA, 
35L), class = "data.frame")

names <- levels(as.factor(seg.f$seg.name))
seg.num <- length(names)
colors   <- rainbow(seg.num, alpha=0.5);
db       <- segAnglePo(seg.f, names)

pdf("test.pdf")
par(mar=c(2, 2, 2, 2));
plot(c(1,800), c(1,800), type="n", axes=FALSE, xlab="", ylab="", main="");
circos(R=320, type="chr", cir=db, col=colors, print.chr.lab=TRUE, W=4, scale=TRUE);


 

When using the subset by running the code above, I am getting the error

Error in 1:scale.n : NA/NaN argument
In addition: Warning message:
In do.scale.cir(xc = xc, yc = yc, the.r = r + 10, total.num = total.num,  :
  NAs introduced by coercion to integer range

after the command

circos(R=320, type="chr", cir=db, col=colors, print.chr.lab=TRUE, W=4, scale=TRUE)

Any suggestion what has caused the error?

sessionInfo()

R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)

locale:
[1] C

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets
[8] methods   base     

other attached packages:
[1] OmicCircos_1.12.0    GenomicRanges_1.26.3 GenomeInfoDb_1.10.3
[4] IRanges_2.8.1        S4Vectors_0.12.1     BiocGenerics_0.20.0

loaded via a namespace (and not attached):
[1] zlibbioc_1.20.0      BiocInstaller_1.24.0 tools_3.3.0         
[4] XVector_0.14.0       RCurl_1.95-4.8       bitops_1.0-6        

Thanks in advance.

Regards Stefan

OmicCircos • 2.5k views
ADD COMMENT
0
Entering edit mode
The error message disappears when using the option
scale=FALSE
to to circos-command. It seems that circos does not deals correct with segments containing only one element.
ADD REPLY

Login before adding your answer.

Traffic: 540 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