readCcgHeader() gives unnecessary readBin() warning
Closed this issue · 1 comments
HenrikBengtsson commented
> library("affxparser")
> path <- system.file(package="AffymetrixDataTestFiles", mustWork=TRUE)
> path <- file.path(path, "rawData", "FusionSDK_Test3", "Test3", "2.Calvin")
> hdr <- readCcgHeader(file.path(path, "Test3-1-121502.CEL"))
Warning message:
In readBin(con, what = integer(), size = 4, signed = FALSE, endian = "big", :
'signed = FALSE' is only valid for integers of sizes 1 and 2```
HenrikBengtsson commented
Fixed in several places, e.g.
readUInt <- function(con, n=1, ...) {
# NOTE: Ideally we would use signed=FALSE here, but there is no
# integer data type in R that can hold 4-byte unsigned integers.
# Because of this limitation, readBin() will give a warning that
# signed=FALSE only works for size=1 or 2.
# WORKAROUND: Use signed=TRUE and assume there are no values
# greater that .Machine$integer.max == 2^31-1. /HB 2015-04-15
readBin(con, what=integer(), size=4, signed=TRUE, endian="big", n=n);
}