HenrikBengtsson / affxparser

🔬 R package: This is the Bioconductor devel version of the affxparser package.
http://bioconductor.org/packages/devel/bioc/html/affxparser.html
7 stars 3 forks source link

readCcgHeader() gives unnecessary readBin() warning #12

Closed HenrikBengtsson closed 9 years ago

HenrikBengtsson commented 9 years ago
> 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 9 years ago

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);
  }