Skip to content

Commit

Permalink
Marker genes: Pre-commit reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lenatr99 committed May 31, 2024
1 parent cce9899 commit 8003344
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def test_available_sources(self):
When more available unittest will be changed.
"""
self.assertListEqual(
["CellMarker", "DictyBase", "Panglao"], list(self.widget.available_sources.keys())
["CellMarker", "DictyBase", "Panglao"],
list(self.widget.available_sources.keys()),
)

def test_source_changed(self):
Expand Down
26 changes: 19 additions & 7 deletions orangecontrib/bioinformatics/widgets/OWMarkerGenes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" OWMarkerGenes """

from typing import List, Tuple, Iterable, Optional
from functools import partial

Expand Down Expand Up @@ -44,7 +45,11 @@
GROUP_BY_ITEMS = ["Cell Type", "Function", "Milestones", "Regulon cluster"]
FILTER_COLUMNS_DEFAULT = ["Name", "Entrez ID"]
NUM_LINES_TEXT = 5
MAP_GROUP_TO_TAX_ID = {'Human': '9606', 'Mouse': '10090', "Dictyostelium discoideum": '44689'}
MAP_GROUP_TO_TAX_ID = {
'Human': '9606',
'Mouse': '10090',
"Dictyostelium discoideum": '44689',
}


class TreeItem(object):
Expand Down Expand Up @@ -854,7 +859,7 @@ class Outputs:
selected_genes = settings.ContextSetting([])

settings_version = 2

available_groups = GROUP_BY_ITEMS
_available_groups = None

Expand Down Expand Up @@ -1021,12 +1026,16 @@ def data(self, value: Table):
self.organism_index = min(
max(self.organism_index, 0), len(group_values) - 1
)

self.available_groups = [item for item in GROUP_BY_ITEMS if any(meta.name == item for meta in domain.metas)]


self.available_groups = [
item
for item in GROUP_BY_ITEMS
if any(meta.name == item for meta in domain.metas)
]

self.group_by_cb.clear()
self.group_by_cb.addItems(self.available_groups)
self.group_by_cb.setCurrentIndex(self.selected_root_attribute)
self.group_by_cb.setCurrentIndex(self.selected_root_attribute)

self._set_group_index(self.organism_index)

Expand Down Expand Up @@ -1079,7 +1088,10 @@ def _setup(self) -> None:
data_not_selected, data_selected = self._filter_data_group(self.data)

if self._available_groups:
if self._available_groups[self._selected_root_attribute] not in self.available_groups:
if (
self._available_groups[self._selected_root_attribute]
not in self.available_groups
):
self.selected_root_attribute = 0

# add model to available markers view
Expand Down

0 comments on commit 8003344

Please sign in to comment.