nguyen1j / py-fcm

Automatically exported from code.google.com/p/py-fcm
0 stars 0 forks source link

loadFCS failing in parse_data #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use fcm.loadFCS on the attached datafile

What is the expected output? What do you see instead?

Data should be loaded, getting KeyError when accessing 'datatype' of text 
variable.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pablo/workspace/virtualenvs/flow_cyto_tools/local/lib/python2.7/site-packages/fcm/io/readfcs.py", line 519, in loadFCS
    data = tmp.get_FCMdata(auto_comp, **kwargs)
  File "/home/pablo/workspace/virtualenvs/flow_cyto_tools/local/lib/python2.7/site-packages/fcm/io/readfcs.py", line 98, in get_FCMdata
    data = self.parse_data(self.cur_offset, dstart, dstop, text)
  File "/home/pablo/workspace/virtualenvs/flow_cyto_tools/local/lib/python2.7/site-packages/fcm/io/readfcs.py", line 279, in parse_data
    dtype = text['datatype']
KeyError: 'datatype'

What version of the product are you using? On what operating system?

pyfcm 0.9.5 (hg clone of today's source)

Linux #### 3.2.0-61-generic #93-Ubuntu SMP Fri May 2 21:33:33 UTC 2014 i686 
athlon i386 GNU/Linux

Please provide any additional information below.

Original issue reported on code.google.com by Pablo.Ba...@gmail.com on 11 May 2014 at 8:58

Attachments:

GoogleCodeExporter commented 8 years ago
Looking into it.

Original comment by Jacob.Frelinger@gmail.com on 12 May 2014 at 4:13

GoogleCodeExporter commented 8 years ago
okay looks like the problem arises because the key value pairs in the text 
segment has an empty value for one of the pairs (/key// instead of /key/value/) 
which causes the regex that splits the pairs to fail.  I've replaced it with a 
loop (shouldn't be too much of a performance hit as the text segments are not 
that big)  Please try the attached readfcs.py and let me know if that works for 
you.

Original comment by Jacob.Frelinger@gmail.com on 12 May 2014 at 4:35

Attachments:

GoogleCodeExporter commented 8 years ago
I applied the replacement readfcs.py and it appears to be fixed. Thanks for the 
quick response and assistance.

Original comment by Pablo.Ba...@gmail.com on 12 May 2014 at 4:33