我正在使用python脚本来读取mzXML文件。我可以解析我想要的数据,但它是zlib压缩的。我尝试过使用zlib库,但它给了我以下错误:
zlib.error: Error -3 while decompressing data: incorrect header check
我理解错误是由于缺少标题检查但我不知道如何给它。这是我试图解码的数据
compressedLen="3830"
precision="64"
byteOrder="network"
contentType="m/z-int"eJwtWXdclNcShVhjRQUVC116c+lFWFl6c+lLiVQReIpYAFFQBCxYELazgCIqFtAYlWjsGpJYYoxRX2yJGsEeXzDYYnvxHPlnfjNz5szMvfvdhnDRxQda//4J/coqyz/KxSeWn/goR9rfFH6UpTPGQxoFHId9SYED8FMO9739UZab/ATdrX8JcOVWC4CbHHQnDbrzAaOP0nhRKvUZoyHdvmqDvVyajDjrJBfwlB95DLtVtwXqWda9HXlML7oiriL0FOyCxUmQFcnZwE9YshF5K7JUsJuefEZ/7VTw62/8hfrDodBtK1Y1f5SVV81gH7t8I+yVPWJIvd2XwVc1KBf8Y/QnAl+VYow6rao7gFsZMQG6Q8Is1Lmq30Lo4wc2wV+d0wzdpEAH+prKM+AzKvsbcl0y40w6JqKOmgXlyOO4/zvga5Z+x/7FcZA1e7YCZ15oSPwzAeoUDHMH33pzGew2na8QX5uegPwBNg+oV8bAP2pxKvC1x3+D39n9Cca39ko/+D27i6k/eQJ+Q58BjH/1FnYjKz3E1U04D//orgzUXWe1EtJqsSd46oQjIa0vL6ffj78z203nwFcX0AkelzFjqEdVQEZHD6aeLkFcsFhEveAI4r2Ef5O/SAMZen4T9ZKTwFmmNKOuunVOnK/5F1hv3ShI8bMU1qMKhR6/tJnxG6wQHzy1iPmau9CvaAx//3WtSuAsFeXEt4cAJzw0APNTt/tr4Hz8ihl/8A74gwML6D9agLjwJXmMP/kbcL6604g/rUZ8cpaM9f04H3qiaxHmq+6SCnbXD87kuzoL/E57bNjfjZvA295TsN5bc4ATv3iPPur+bAHOy0+X/D068HvE1xPfmwgZPTgPfqmWHucjV4J6pf1F4PH3uw8pHSKBnKk1iH6dM5DGZ2ORRzqqCPwhWd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32euj610aAv37IVujO+yIQXz/6AnRLhT79BnbIMzm6HXz1JkXQp36xiH7LJMSZTOZ9sN7OAf0FxLYzn6AYunjYafDWC0dBmkdwna73Wwndtn0f9TC+v7lU2TI+rhv8Nv5Z1BN/Ap/Nh+HUv7jC+ozLWE/WMYyrQdAU5svpD2nXxne++vxxiA9c0Jf6vDDEeyxSM77EDv6Q7Z+znuXZ4LNTXCO+djr0IB3eu+o38T3c+zXPD/U7+d7k9Nlp1reX770BY/n91x/UgvQ4e4X1HU1Ff7b7uR/Wd56DtAqJpX7rMsereBX57t4Av9s+Fet7NAQ40ToF+Z+8A07g95Dxb/MhAzzeAK8Z2AK+8C/z0KdG5z+IEy30pq73jvMRy3crjf4a+B1O8/1RY8D1R+8G3780NgaIc8jfhro0nj8jj0m3IfP5813Udh/fhTVBW4B3D+C7iCZCAt3CZAP9abvB7xLC71qTk4N+PJ5uw3hrZqfA7vxhNHCaCr7PhAw2p75CHzxmq7hva9SPgfcp5T6oaSwETqTh+66mpRC4yTX8P5DmHr8zx93jGP88AbjAl9vQb4P2eeQLfsL3m4Z+4+F3G3sY+AbdB+jHtYLvUA0GnEf/hB7YG0zmIr/X0QD6HfIRb6TH98iG8JXwO4Y/h70hm+dd1wFrmH8O3/WcJUOIL+L/M6YOfEy98inqcHjPd9+Gmh3g8/7yAP34mf+rx/G9ouEH/r/BbT/PXw2Xf0Eek9zJ1J88RB2CaI5jQ89hzq+I72SNAzYj3mK9C/I06v4K/6S5fA9rtOG7m+M5vm82CoaB19GV77qN7nxPdfVzox5rhzzGfXQZv5nf0
这是Proteomic扫描的峰值数据。任何帮助理解这些信息将不胜感激。
答案 0 :(得分:0)
解决了这个问题。能够使用此library
中的代码读取Base64解码数据以下是代码段:
def parse_peaks(peaks_decoded):
#Based on code by Taejoon Kwon (https://code.google.com/archive/p/massspec-toolbox/)
tmp_size = len(peaks_decoded)/4
unpack_format1 = ">%dL" % tmp_size
idx = 0
mz_list = []
intensity_list = []
for tmp in struct.unpack(unpack_format1,peaks_decoded):
tmp_i = struct.pack("I",tmp)
tmp_f = struct.unpack("f",tmp_i)[0]
if( idx % 2 == 0 ):
mz_list.append( float(tmp_f) )
else:
intensity_list.append( float(tmp_f) )
idx += 1
return mz_list,intensity_list