eyurtsev / fcsparser

A python parser for reading fcs files supporting FCS 2.0, 3.0, 3.1
MIT License
73 stars 43 forks source link

Update fromfile to support 3-byte fields #17

Closed bpteague closed 3 years ago

bpteague commented 6 years ago

Some FCS files (such as the one generated by the Cytek xP5) store integers in 3-byte fields. This breaks numpy's parser, which only wants power-of-two sized fields. So, I've updated fromfile() to parse FCS files as a table of 1-byte unsigned ints, expand those fields to 4 bytes, and then re-view them as the proper dtype.

My only concern is that this may break on an FCS file produced by a big-endian machine (because I'm adding the extra bytes to the beginning of the field). I don't have ready access to any of those -- do you?

bpteague commented 6 years ago

Also, here's the fcs file I'm using for testing:https://github.com/bpteague/cytoflow/blob/master/cytoflow/tests/data/instruments/Cytek%20xP5.fcs

bpteague commented 3 years ago

Superseded by #32 -- closing this one.