#!/usr/bin/env python # coding: utf-8 # # Working with the fcs parser # # **ATTENTION** The parser returns the data exactly as recorded in the file. This means that no transformations or compensation have been applied to this data. It is up to you to transform the data from this point for doing analysis and visualization. # In[1]: get_ipython().run_line_magic('pylab', 'inline') # In[2]: import fcsparser path = fcsparser.test_sample_path # path to a test data file that is included with the package # # Unpack meta only # In[3]: meta = fcsparser.parse(path, meta_data_only=True) print type(meta) print meta.keys() # # Unpack meta and reformat # In[4]: meta = fcsparser.parse(path, meta_data_only=True, reformat_meta=True) meta['_channels_'] # # Unpack meta and data # In[5]: meta, data = fcsparser.parse(path, meta_data_only=False, reformat_meta=True) # In[6]: print type(meta) print type(data) # In[7]: data # # Untransformed data # # The plot below is a plot of the raw data as recorded in the file. Specifically, no compensation or transformation has been applied to this data. # # To better visualize this data you might want to take a look at either hlog or logicle transformations. # In[8]: scatter(data['FITC-A'], data['AmCyan-A'], alpha=0.8, color='gray')