[BioC] errors with read.maimages
Martin Morgan
mtmorgan at fhcrc.org
Tue Dec 18 18:40:57 CET 2007
Hi Ana --
It would help to see the results of sessionInfo(), which would include
at the top something about the 'locale'. This is likely a font
encoding issue, see this earlier thread:
https://stat.ethz.ch/pipermail/bioconductor/2007-July/018204.html
Here's the relevant snippet (quoting myself)
> I now change my system local to be like yours
> > Sys.setlocale("LC_ALL", "en_US.UTF-8")
> [1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=C"
> and try to read the files
> > read.maimages(fname, columns=columns)
> Error in readGenericHeader(fullname, columns = columns, sep = sep) :
> Specified column headings not found in file
> In addition: Warning message:
> In grep(a, txt) : input string 1 is invalid in this locale
> Ah ha! This seems to be the problem. So set the locale to "en_US"
> > Sys.setlocale("LC_ALL", "en_US")
> [1] "LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=en_US;LC_COLLATE=en_US;LC_MONETARY=en_US;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=C"
> > res <- read.maimages(fname, columns=columns)
> Read B12Z0471_A.GPR
> Does this work for you? Alternatively here's an interesting solution
> that 'just works':
(other non-UTF-8 files should also work; once the files are read in it
is fine to set the locale back to the original). Please let the list
know if this is successful.
Developers hoping to smooth this wrinkle over for users might read
https://stat.ethz.ch/pipermail/r-devel/2007-September/046793.html
Ana Conesa <aconesa at cipf.es> writes:
> Dear List,
>
> I am getting a couple of erros when trying to import gpr files using
> the read.maimages of Limma
>
> RG1<-read.maimages(targets1,source="genepix")
> Error in sub(pattern, replacement, x, ignore.case, extended, fixed,
> useBytes) :
> input string 1 is invalid in this locale
>
> In this case I simply cannot load the corresponding gpr files
>
>
> > f<-function(x)as.numeric(x$Flags>-99)
> > RG2<-read.maimages(targets2,source="genepix",wt.fun=f)
> Error in gsub(pattern, replacement, x, ignore.case, extended, fixed,
> useBytes) :
> input string 1 is invalid in this locale
>
> In this case I have problems when trying to read the flags but it will
> work OK if I skip the wt.fun parameter
>
>
>
> In all cases I am using gpr files generated in the same project and I am
> able to read other gpr files from the same platform (but never succeed
> in getting the flags)
>
>
> I am using R 2.5.1 on a Kubuntu 7.10 machine
> Any tips on what to do are much appreciated
>
> Thanks
>
>
> Ana
>
> ------------------------------------------
> Ana Conesa, PhD
> Bioinformatics Department
> Centro de Investigación Príncipe Felipe
> Avda. Autopista Saler, 16
> 46013 Valencia Spain
> http://bioinfo.cipf.es/aconesa
> ==========================================
> CAMDA2007 Conference @ CIPF
> http://camda.bioinfo.cipf.es
>
> _______________________________________________
> 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 M2 B169
Phone: (206) 667-2793
More information about the Bioconductor
mailing list