Skip to content
Prev 206397 / 398503 Next

memDecompress and zlib compressed base64 encoded string

Prof Brian Ripley wrote:

            
I am dealing with mass spectrometric data in a XML file format (mzXML). The 
biggest part of the contained data is actual mass spectra that are base64 
encoded and optionally compressed using http://zlib.net (saving quite some 
storage space). When they are compressed I just get an XML node that looks 
like this
   <peaks>CONTENT OF THE ORIGINAL ATTACHMENT HERE</peaks>
I would like to be able to decompress that string and thought that 
memDecompress was the right tool to do so ...
I'm actually reading this in as a string from the XML file ...
Yup, that was plain stupid and trying to make memDecompress run at all 
(since handing it the character string also resulted in an error.
R version 2.10.1 (2009-12-14) 
x86_64-pc-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rkward_0.5.1

loaded via a namespace (and not attached):
[1] tools_2.10.1

Thanks for any further hints, Joh