Skip to content
Prev 6448 / 21312 Next

[Bioc-devel] Non-ASCII in datase from Biomart EMBL via Gviz package

I don't know exactly how you are triggering this warning.  If you have the
ability to prefilter your content before serializing, that may be best.
The following
is from the gwascat package.  You have very little chance, I believe, of
getting an
institutional guarantee that only ascii will go into their emissions.

fixNonASCII = function(df) {
 hasNonASCII = function(x) {
   asc = iconv(x, "latin1", "ASCII")
   any(asc != x | is.na(asc))
   }
 havebad = sapply(df, function(x) hasNonASCII(x))
 if (!(any(havebad))) return(df)
 message("NOTE: input data had non-ASCII characters replaced by '*'.")
 badinds = which(havebad)
 for (i in 1:length(badinds))
   df[,badinds[i]] = iconv(df[,badinds[i]], to="ASCII", sub="*")
 df
}



On Sun, Oct 12, 2014 at 2:14 PM, Martin, Tiphaine <tiphaine.martin at kcl.ac.uk