[BioC] Error with read.maimages

Martin Morgan mtmorgan at fhcrc.org
Tue Apr 6 04:51:20 CEST 2010


Hi Luis --

On 04/05/2010 09:10 AM, lapereir at uc.cl wrote:
> HI!!
> 
> I am sorry, i read the posting guide but for some reason i dont read that
> requirement. So here i write the output of sessionInfo(), also include the
> traceback() ouput and Sys.getlocale().
> 
>> Sys.getlocale()
> [1] "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8"

I think the suggestion was to change this like

> Sys.setlocale(locale="C")
[1]
"LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C"

I think this will work on your operating system, but it may be necessary
to start R in the correct locale.

Martin


>> traceback()
> 6: gsub("\\.", "\\\\.", x)
> 5: protectMetachar(allcnames[i])
> 4: grep(protectMetachar(allcnames[i]), text.to.search)
> 3: read.columns(fullname, required.col, text.to.search, skip = skip,
>        sep = sep, quote = quote, stringsAsFactors = FALSE, fill = TRUE,
>        flush = TRUE, ...)
> 2: switch(source2, quantarray = {
>        firstfield <- scan(fullname, what = "", sep = "\t", flush = TRUE,
>            quiet = TRUE, blank.lines.skip = FALSE, multi.line = FALSE,
>            allowEscapes = FALSE)
>        skip <- grep("Begin Data", firstfield)
>        if (length(skip) == 0)
>            stop("Cannot find \"Begin Data\" in image output file")
>        nspots <- grep("End Data", firstfield) - skip - 2
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, nrows = nspots, flush = TRUE, ...)
>    }, arrayvision = {
>        skip <- 1
>        cn <- scan(fullname, what = "", sep = sep, quote = quote,
>            skip = 1, nlines = 1, quiet = TRUE, allowEscape = FALSE)
>        fg <- grep(" Dens - ", cn)
>        if (length(fg) != 2)
>            stop(paste("Cannot find foreground columns in", fullname))
>        bg <- grep("^Bkgd$", cn)
>        if (length(bg) != 2)
>            stop(paste("Cannot find background columns in", fullname))
>        columns <- list(R = fg[1], Rb = bg[1], G = fg[2], Gb = bg[2])
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, flush = TRUE, ...)
>        fg <- grep(" Dens - ", names(obj))
>        bg <- grep("^Bkgd$", names(obj))
>        columns <- list(R = fg[1], Rb = bg[1], G = fg[2], Gb = bg[2])
>        nspots <- nrow(obj)
>    }, bluefuse = {
>        skip <- readGenericHeader(fullname, columns = c(columns$G,
>            columns$R))$NHeaderRecords
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, flush = TRUE, ...)
>        nspots <- nrow(obj)
>    }, genepix = {
>        h <- readGPRHeader(fullname)
>        if (verbose && source == "genepix.custom")
>            cat("Custom background:", h$Background, "\n")
>        skip <- h$NHeaderRecords
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, flush = TRUE, ...)
>        nspots <- nrow(obj)
>    }, smd = {
>        skip <- readSMDHeader(fullname)$NHeaderRecords
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, flush = TRUE, ...)
>        nspots <- nrow(obj)
>    }, {
>        skip <- readGenericHeader(fullname, columns = columns, sep =
> sep)$NHeaderRecords
>        obj <- read.columns(fullname, required.col, text.to.search,
>            skip = skip, sep = sep, quote = quote, stringsAsFactors = FALSE,
>            fill = TRUE, flush = TRUE, ...)
>        nspots <- nrow(obj)
>    })
> 1: read.maimages(targets, source = "genepix", wt.fun = f)
> 
>> sessionInfo()
> R version 2.10.0 (2009-10-26)
> i386-apple-darwin9.8.0
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> other attached packages:
> [1] limma_3.2.1
> 
> Well, sorry for the extention, but hopefully i cant get an anwser and if this
> not the
> 
> Greets
> 
> 
> 
> Vincent Carey escribió:
>> Please read the posting guide.  You did not provide the result of
>> sessionInfo().  You may be using an inconvenient locale.  Typically if the
>> following holds
>>
>>> Sys.getlocale()
>> [1] "C"
>>
>> you will not run into the error noted for this task.
>>
>> On Sun, Apr 4, 2010 at 9:31 PM, <lapereir at uc.cl> wrote:
>>
>>> Dear list
>>>
>>> I am getting a couple of erros when trying to  import gpr files using the
>>> read.maimages of Limma.
>>>
>>>> targets<-readTargets("targets.txt")
>>>> RG <- read.maimages(targets, source="genepix", wt.fun=f)
>>> Error in gsub("\\.", "\\\\.", x) :
>>> input string 1 is invalid in this locale
>>>
>>> I search in R Help for the function of gsub, but i cannot fix the error
>>> that
>>> give me, so that i cant import any genepix (.gpr) files.
>>>
>>> Thank
>>> Luis
>>>
>>> _______________________________________________
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>> Search the archives:
>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>
>>
> 
> 


-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list