Within the library the required packages for the code to run correctly are imported.

If there's an import error check the following things:

  1. Check pandas is isntalled.
  2. Check fcs parser is installed.
  3. Check OS is installed.

Once you've checked this run this code in 4 simple steps:

1. import the cytometry_lib library.


In [ ]:
import cytometry_lib as cy

Make sure in the following cell that the directories are correct. Only the fcs must exist and have fcs data on it as the other two will be created in the process. The directory path syntaxis varies between OS

2. Save directory locations.


In [ ]:
fcs_dir = './fcs sample data/'      # This is the directory of the .fcs files in this case  
csv_dir = 'csv_files/'               # This is where the converted data will be stored
merged_csv_dir = 'merged_data/'      # This is where the final merged dataframe will be stored
merged_filename = 'data'            # This  is  the name

The next line of code converts fcs files in the fcs directory to csv files in the csv directory.

3. Convert fcs files to csv files.


In [ ]:
cy.fcs_to_csv(fcs_dir,csv_dir)

The next line of code takes the csv files, merges them into a single dataframe and saves it in the specified directory.

4. Merge the data into the same dataframe.


In [ ]:
cy.merge_dfs(csv_dir,merged_csv_dir,merged_filename)