Edit on GitHub

starplast.discoveries_panel

The Discoveries tab: what Starplast infers about genes nobody has labelled, and how each claim was tested -- condensed to one line per claim, with every claim a click from its reasoning.

Read from the shipped claims (claims.shipped), so opening it costs a lookup. The defaults show only claims worth a person's time: tested by evidence measured to be independent of what generated them, confident, and well above how common the claimed class is anyway. Every filter is visible and can be loosened; nothing is hidden that the person cannot bring back.

TIPS = {'label': 'Which kind of knowledge: a localization, a phenotype, a stage. Each label has its own recipe -- the generator, and the checks measured to be independent of it.', 'status': "Tested: an independent check agreed or disagreed. Untested: nothing independent reaches the gene, so only the generator's certainty is known. Outside the tested range: unlike every gene certainty was measured on, so no number is attached.", 'confidence': 'Of held-out genes given claims this confident, at least this share were right. Measured, not estimated: certainty is fit on genes whose answer was hidden.', 'lift': 'Confidence over how common the claimed class is among labelled genes. A claim of a class that is 80% of genes at 85% confidence says little; lift 2 or more says something.', 'table': "Click a claim to open it in the evidence panel: what was claimed, by what, how it was tested and what this recipe's claims were worth on held-out genes.", 'export': 'Save the claims shown, with every number and verdict, as a table.', 'colour': 'Colour the map by this label: measured genes in full colour, claimed genes in their claimed class faded by how uncertain the claim is, unclaimed genes grey.', 'recipes': 'Why each label has the claims it has: the recipe chosen, whether it is calibrated end to end, and what its claims were worth on held-out genes.'}
STATUSES = ('tested', 'untested', 'outside tested range')
COLUMNS = ('gene_id', 'product', 'label', 'claim', 'confidence', 'lift', 'checks', 'status')
class DiscoveriesPanel(PyQt6.QtWidgets.QWidget):

Filters on top, one condensed line of what they leave, then the claims.

DiscoveriesPanel(organism: str, products=None, parent=None)
def gene_chosen(unknown):

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.

def claim_chosen(unknown):

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.

def colour_by(unknown):

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal's arguments.

organism
products
frame
summary
label
status
confidence
lift
colour
export
table
recipes
shown
def selection(self) -> pandas.DataFrame:

The claims the filters leave, most confident first.

def refresh(self):

Re-apply the filters: the summary line, the table and the recipe note.

def save(self, path: str = '') -> int:

Write the claims shown to CSV or TSV. Returns how many rows were written.

def install(window) -> DiscoveriesPanel | None:

Add the Discoveries tab beside Strategies and wire it to the evidence panel and the map.