Roestlab / massdash

MassDash: A web-based dashboard for streamlined DIA-MS visualization, analysis, prototyping, and optimization
https://massdash.streamlit.app/
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

sqMass Data Access Compression Level 1 #53

Closed singjc closed 7 months ago

singjc commented 7 months ago

Need to add a check for compression level 1, when the data is only zlib compressed. This is usually is not the case if you output a sqMass directly from OpenSwathWorkflow. However, if you output a chrom.mzML and then convert the chrom.mzML to chrom.sqMass, then the compression can be set to 1, zlib only, depending on what flags are set inOpenSwathMzMLFileCacher

Can simply add the following in the _returnDataForChromatogram method

import struct

if compr == 1:
    tmp = zlib.decompress(d)
    result = struct.unpack("<%sd" % (len(tmp) // 8), tmp)

Note: this assumes the data is 64 bit data. I don't think the sqmass stores what type of data the arrays are stored as, but for 32-bit, we could just do result = struct.unpack("<%sd" % (len(tmp) // 4), tmp)

singjc commented 7 months ago

Addressed in #58