TASBE / TASBEFlowAnalytics

Flow cytometry unit conversion and analytics
Other
7 stars 8 forks source link

setting calibration.overrideAutofluorescence via octave leads to an out of bound error #527

Open georgebzheng opened 3 years ago

georgebzheng commented 3 years ago

The following code was used in the flow ETL app to set calibration.overrideAutofluorescence to 10, and this led to an out of bound error when per_color_constitutive_analysis was invoked later. After tracing the error in readfcs_compensated_au.m, I noticed that there were fewer autofluorescence_model elements (2) than the number of channels (7). TASBE should provide more explicit message to describe the cause of the issue.

124     if 'calibration' in self.obj['TASBEConfig'] and 'overrideAutofluorescence' in self.obj['TASBEConfig']['calibration']:
125         logger.info(f'setting calibration.overrideAutofluorescence: {self.obj["TASBEConfig"]["calibration"]["overrideAutofluorescence"]}')
126         self.octave.eval('TASBEConfig.set(\'calibration.overrideAutofluorescence\', \'{}\');'.format(self.obj['TASBEConfig']['calibration']['overrideAutofluorescence']))

and the log prints out this for the above:

2021-07-15 23:49:52,253 - colormodel - INFO - setting flow.channel_template_file to aq1fvarrp4whe8v.fcs
2021-07-15 23:49:52,276 - colormodel - INFO - setting calibration.overrideAutofluorescence: 10

the error encountered:


error: CM(3): out of bound 2
error: called from:
    readfcs_compensated_au at line 51, column 17
    readfcs_compensated_ERF at line 16, column 33
    read_data at line 28, column 33
    per_color_constitutive_analysis at line 32, column 27