Skip to content

[Bioc-devel] read.maimages, limma

4 messages · Tarca Adi Laurentiu, Martin Maechler, Gordon K Smyth

#
Hi everyone,

I am using R.2.1.0 with limma 1.8.18 to read a "quantarray" .txt file.
 > RG <- read.maimages(file,source="quantarray")
Error in "[.data.frame"(obj, , columns$Rf) :
         undefined columns selected

The same data with the previous version of R (2.0.1) was working fine.
Does anyone have a suggestion?

Laurentiu
#
Tarca> Hi everyone,

    Tarca> I am using R.2.1.0 with limma 1.8.18 to read a "quantarray" .txt file.
    >> RG <- read.maimages(file,source="quantarray")
    Tarca> Error in "[.data.frame"(obj, , columns$Rf) :
    Tarca> undefined columns selected

    Tarca> The same data with the previous version of R (2.0.1) was working fine.
    Tarca> Does anyone have a suggestion?

Since you are from a place where ? , ? etc are not entirely
unreasonable: Could it be that you have non-ASCII characters in your data
file?

If so, this could be the explanation: If your locale setting {
help(Sys.locale) } is unicode-ish {e.g. fr_CA.utf-8}, then
text connections will assume unicode rather than iso-latin-*
encoding, unless you specify the encoding:

We had a similar problem with read.table where we needed to use
   read.table(file("foo.txt", encoding="LATIN1"), ........)
instead of
   read.table("foo.txt", ........)

Alternatively, you could set    options(encoding = "LATIN1")
before reading the files
{if almost all of your input file use ISO-latin-1 aka iso-8859-1 encoding}

Does that help?
Martin Maechler, ETH Zurich
#
At 06:08 AM 12/04/2005, Tarca Adi Laurentiu wrote:
You haven't said which version of limma you were using with R 2.0.1. If it 
was limma 1.8.18, then the change must  be with R. If it was an earlier 
version of limma, I can check for limma changes.

When people have had this or similar errors in the past, it has usually 
been because a problem with their input files. It would be helpful for you 
to give the header lines from the first of your input files.

Gordon
1 day later
#
Dear Laurentiu,

Thank you for alerting me to this problem, and thank you for providing your 
input file (off-line) which was essential for tracing the problem.

The error is caused by a new "feature" of the scan() function in R base. 
The NEWS file for R 2.1.0 says

     scan() has a new argument 'allowEscapes' (default TRUE) that
         controls when C-style escapes in the input are interpreted.
         Previously only \n and \r were interpreted, and then only
         within quoted strings when no separator was supplied.

The new behaviour has been made the default behaviour, surprisingly, which 
I think will have the effect of breaking most existing code which uses 
scan() to read delimited text files. The problem occurs when the text 
includes backslashes, such as Windows style file paths, which are now at 
risk of being interpretted as end of lines markers or other control characters.

I will post a fix within 24 hours to the Bioconductor development site as 
limma 1.9.1. The obvious fix will make limma dependent on R 2.1.0.

Gordon
At 06:08 AM 12/04/2005, Tarca Adi Laurentiu wrote: