Skip to content

Commit

Permalink
BUGFIX: typo in Matrix.fluorochromes attribute (closes #206), bump ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
whitews committed Jun 26, 2024
1 parent caea1e1 commit 182a33d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3022,7 +3022,7 @@
" 'custom_spill', \n",
" comp_df.values, # use new values\n",
" comp_mat.detectors, # use old detectors\n",
" fluorochromes=comp_mat.fluorochomes # use old fluoros\n",
" fluorochromes=comp_mat.fluorochromes # use old fluoros\n",
")\n",
"\n",
"sample.apply_compensation(comp_mat_modified)\n",
Expand Down
2 changes: 1 addition & 1 deletion src/flowkit/_models/gating_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def _preprocess_sample_events(self, sample, gate, cache_events=False):
)
matrix = self.comp_matrices[dim.compensation_ref]
try:
matrix_dim_idx = matrix.fluorochomes.index(dim_id)
matrix_dim_idx = matrix.fluorochromes.index(dim_id)
except ValueError:
raise ValueError("%s not found in list of matrix fluorochromes" % dim_id)
detector = matrix.detectors[matrix_dim_idx]
Expand Down
8 changes: 4 additions & 4 deletions src/flowkit/_models/transforms/_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
if fluorochromes is None:
fluorochromes = ['' for _ in detectors]

self.fluorochomes = fluorochromes
self.fluorochromes = fluorochromes

def __repr__(self):
return (
Expand All @@ -91,7 +91,7 @@ def apply(self, sample):
# matrix detectors
sample_fluoro_labels = [sample.pnn_labels[i] for i in sample.fluoro_indices]
if not set(self.detectors).issubset(sample_fluoro_labels):
raise FlowKitException("Detectors must be a subset of the Sample's fluorochomes")
raise FlowKitException("Detectors must be a subset of the Sample's fluorochromes")

indices = [
sample.get_channel_index(d) for d in self.detectors
Expand All @@ -115,7 +115,7 @@ def inverse(self, sample):
# matrix detectors
sample_fluoro_labels = [sample.pnn_labels[i] for i in sample.fluoro_indices]
if not set(self.detectors).issubset(sample_fluoro_labels):
raise FlowKitException("Detectors must be a subset of the Sample's fluorochomes")
raise FlowKitException("Detectors must be a subset of the Sample's fluorochromes")

indices = [
sample.get_channel_index(d) for d in self.detectors
Expand All @@ -137,7 +137,7 @@ def as_dataframe(self, fluoro_labels=False):
:return: pandas DataFrame
"""
if fluoro_labels:
labels = self.fluorochomes
labels = self.fluorochromes
else:
labels = self.detectors

Expand Down
2 changes: 1 addition & 1 deletion src/flowkit/_utils/gml_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _add_matrix_to_gml(root, matrix, ns_map):

fluoros_ml = etree.SubElement(xform_ml, "{%s}fluorochromes" % ns_map['transforms'])

for fluoro in matrix.fluorochomes:
for fluoro in matrix.fluorochromes:
fluoro_ml = etree.SubElement(fluoros_ml, '{%s}fcs-dimension' % ns_map['data-type'])
fluoro_ml.set('{%s}name' % ns_map['data-type'], fluoro)

Expand Down
4 changes: 2 additions & 2 deletions src/flowkit/_utils/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def plot_gate(
# might be a label reference in the comp matrix
matrix = gating_strategy.get_comp_matrix(dim_comp_refs[0])
try:
matrix_dim_idx = matrix.fluorochomes.index(dim_ids_ordered[0])
matrix_dim_idx = matrix.fluorochromes.index(dim_ids_ordered[0])
except ValueError:
raise ValueError("%s not found in list of matrix fluorochromes" % dim_ids_ordered[0])
detector = matrix.detectors[matrix_dim_idx]
Expand All @@ -744,7 +744,7 @@ def plot_gate(
# might be a label reference in the comp matrix
matrix = gating_strategy.get_comp_matrix(dim_comp_refs[1])
try:
matrix_dim_idx = matrix.fluorochomes.index(dim_ids_ordered[1])
matrix_dim_idx = matrix.fluorochromes.index(dim_ids_ordered[1])
except ValueError:
raise ValueError("%s not found in list of matrix fluorochromes" % dim_ids_ordered[1])
detector = matrix.detectors[matrix_dim_idx]
Expand Down
6 changes: 3 additions & 3 deletions src/flowkit/_utils/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def _parse_matrix_element(
data_type_namespace
):
matrix_id = find_attribute_value(matrix_element, xform_namespace, 'id')
fluorochomes = []
fluorochromes = []
detectors = []
matrix = []

Expand All @@ -397,7 +397,7 @@ def _parse_matrix_element(
raise ValueError(
'Dimension name not found (line %d)' % dim_el.sourceline
)
fluorochomes.append(label)
fluorochromes.append(label)

detectors_el = matrix_element.find(
'%s:detectors' % xform_namespace,
Expand Down Expand Up @@ -444,7 +444,7 @@ def _parse_matrix_element(

matrix = np.array(matrix)

return Matrix(matrix_id, matrix, detectors, fluorochomes)
return Matrix(matrix_id, matrix, detectors, fluorochromes)


def _parse_fratio_element(transform_id, fratio_element, transform_namespace, data_type_namespace):
Expand Down
2 changes: 1 addition & 1 deletion src/flowkit/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
FlowKit version
"""
__version__ = "1.1.1"
__version__ = "1.1.2"

0 comments on commit 182a33d

Please sign in to comment.