Giter VIP home page Giter VIP logo

latools_gui's People

Contributors

aidengeorge97 avatar margaretharrison avatar oscarbranson avatar simonpetocz avatar u6052029 avatar zanerog avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ch-king

latools_gui's Issues

Window Resizing: Pane Behaviour

Tweak the behaviour of pane resizing when the window is resized.

Ideal Behaviour:

  • navigation Pane has fixed height and scales horizontally with window.
  • controlsPane has fixed height and scales horizontally with window.
  • graphPane scales vertically an horizontally with window.
  • options (samples list and analyte list) are pinned to L and R sides, and graph itself expands to fill extra space in middle.

Stats and Export

Control panel for statistic calculation and data export.

Features:

  • Select statistics to be calculated using check boxes.
  • Export 'raw traces' from any stage of analysis for external analysis/plotting.
  • Export 'minimal dataset' as a .zip file.

Add 'Apply To' option in early processing stages

By default each stage of analysis is applied to the data in the focus attribute. In some stages of analysis, the user may want to apply the operation to a different stage of analysis.

For example, if the user wants to re-do 'despiking', it makes more sense to apply the second round of despiking to the raw data, rather than the previously despiked data.

Implementation

To allow this, we should add an 'apply to' drop-down menu, which contains all the currently available stages of processed data.

Suggest adding this on the lower right of the controlsPane, just to the left of the 'apply' button?

Should be available in the following stages:

  • despiking (#29)
  • autorange (#31)
  • bkg_calculation (#32)

After background subtraction, this option is no longer appropriate, as later stages of analysis have to be based on the background corrected data.

On Selection

The stage of analysis should be passed as a focus_stage variable to each of the appropriate functions.

Prerequisites

Some of these functions don't currently accept a focus_stage argument. Follow oscarbranson/latools#19 for progress on this issue.

Manual

Everything has to be documented!!

Both on the user-facing side, and the back end (so I can maintain the software!)

Ideas:

  • Use sphinx - already set up in repo.
  • Can existing function docstrings and argument descriptions be made available through GUI?

Background Plot

Pop up to visualise calculated background.

Interacts with latools.analyse.

  • Able to select analytes.

GUI Templates

Create blank templates for all elements of the GUI, which can be populated with controls for each stage of analysis.

Templates needed for:

  • Data import (#8)
  • Analytical control panel.
  • Plot pop-up (for #7, #11, #14).
  • Undockable plotting window (for #4).
  • Filtering panel (#16)

All templates must be documented and well-commented.

Appearance

  • Explore PyQt style sheets.
  • Make style sheet for GUI (requires progress on #1)

'Trace Plot' panel

Create a functioning plotting PyQtgraph panel that replicates the functionality of latools.helpers.plot.tplot. Panel will be displayed on lower half of GUI through all stages of analysis. Panel should be able to 'undock' from main window, to facilitate multiple displays.

Needs to interact with latools.analyse (analysis-level) and latools.D (data container) objects.

Should grab data directly from the latools.D data object (all references below are to attributes of a D instance).

Should grab analyte info and list of samples and standards from latools.analyse object.

  • Draft plot that displays data from .data['focus_stage'].
  • Ability to switch between samples (scroll list on left hand side?)
  • Analyte on/of selection checkboxes (right hand side?). Must automatically populate from .analytes, and assign unique colours.
  • Controls for various options of tplot

Setup Autodocs

Autodoc must be configured within Sphinx to read docstrings from the project and format them into neat documentation.

Autodocs will still require some continuous, manual effort to add pointers to each module/class/function, and to organise them neatly within the Sphinx documents.

Calibration Panel

Control panel for calibration.

Needs to handle all arguments to analyse.calibrate.

  • Populate available SRMs from SRM databse. Choose with check-boxes.
  • Need way to visualise calibration (see #14).

Continuous Integration / Testing

Unsure how feasible this is with GUIs, but if possible:

  • Build test-suite alongside
  • Set up Continuous Integration / testing (e.g. with TravisCI) to check all new commits on Linux/Mac/Windows systems.

Filtering Panel

Filtering control panel.

Must be able to:

  • Create filters in any order.
  • Individually activate/deactivate filters for different samples/analytes.
  • Visualise effect of filters.

Plot Updates with Control Panes

Data displayed in the plot should update as processing is applied.

Expected Behaviour

  • Data in the plot should update whenever 'Apply' is clicked in the controlPanel
  • When changing the focus of the controlPanel stack, the data in the plot should also change if that stage of analysis has been applied.

For this second one, I've added an attribute to the analyse class to record which stages of analysis have been conducted (analyse.stages_complete). So perhaps something like:

<click> NextPanel(name_of_next_stage):
  if name_of_next_stage in analyse.stages_complete:
    update_plot()

Control Panel options are populated with function defaults.

You can access function defaults using inspect (in the standard library)

For example:

import inspect
import latools as la

# get function or method signature
sig = inspect.signature(la.analyse.despike)
# collect default arguments into dict
{
    k: v.default
    for k, v in signature.parameters.items()
    if v.default is not inspect.Parameter.empty
}

>> {'autorange_kwargs': {},
    'expdecay_despiker': False,
    'exponent': None,
    'exponentplot': False,
    'maxiter': 4,
    'nlim': 12.0,
    'noise_despiker': True,
    'win': 3}

Can then use this dict to populate defaults?

Instant update to graph

Have the graph instantly update when settings are changed (current sample, visible elements, etc)

Stage: Despiking

Two sub-panes ('boxes?'), one for each depsiker.

Check box at top of pane, with options underneath

Box 1:

  • exponential decay despike - check box
  • exponent - number (optional, default blank)
  • maxiter - integer (default = 4)

Box 2:

  • noise despike - check box
  • 'win' - number (default = 3)
  • nlim - integer (default = 12)
  • maxiter - integer (default = 4)

Pass arguments to method of analyse instance:

despike(self, expdecay_despiker=False, exponent=None,
        noise_despiker=True, win=3, nlim=12., exponentplot=False,
        maxiter=4, autorange_kwargs={}):

Oscar: Need to implement separate maxiter for each despiker

Title Page

  • New Project (define name)

  • Open Project

  • Recent projects dropdown

  • Link to online manual

Blank framework version of the GUI

[Message from Margaret - if Ilya and Zane could create perhaps a check list of things they have done this week for this issue, that would be good! this just lets us and our many eyes know what we've been doing!]

  • example one finished
  • example two not finished
  • ...

UX design

  • Graph out full workflow and user interaction.
  • Identify specific elements/panels which need making.
  • Communicate needs to help #3.

Stage: Autorange

  • analyte - drop down (including all analytes in data, and 'total_counts' option, default=total_counts)
  • gwin - integer (default = 5)
  • swin - integer (default = 3)
  • win - ineger (default = 20)
  • on_mult - double number boxes (default = [1., 1.5])
  • off_mult - double number boxes (default = [1.5, 1])
  • nbin - integer (defualt = 10)
  • log tranform - check box (default = checked)

Arguments passed to method of analyse instance:

autorange(self, analyte='total_counts', gwin=5, swin=3, win=20,
          on_mult=[1., 1.5], off_mult=[1.5, 1], nbin=10,
          transform='log', ploterrs=True)

ploterrs

Need to have some way of handling autorange failures. Let's talk about this later

Graph object functions

  • Swap current sample

  • Switch current stage

  • Update function changes the graph's state based off arguments

Make option names meaningful

  • names/desc done and put into gui for all stages

  • Import data

  • Despike data

  • Autorange

  • Background Calculation / Subtraction

  • Ratio

  • Calibrate

  • Main plot panel controls

  • Background plot controls

  • Calibration plot controls

  • put them in json file so they can be easily updated

Packaging

There should be three package types for final distribution

  • The standard LAtools package, run from the command line by advanced users like Oscar.
  • The intermediate package, which runs the LAtools GUI through the Python interpreter (probably launched by a shortcut or bash script). Assumes the user has installed Python and will be able to run a pip command to install all dependencies.
  • The basic package, which is a stand-alone folder containing the PyInstaller compiled package of the LAtools GUI. Assumes no dependencies or skills on the behalf of the user.

Stage: Data Import

Options that need to be implemented in the Data Import Stage:

  • Browse needs to open file browser, and be able to select a directory.
  • Config - drop down menu with options populated from latools.cfg.
  • SRM Identifier - text field.
  • file extension - text field
  • Internal Standard - text field.

Arguments passed to the initialisation of latools.analyse:

__init__(self, data_folder, errorhunt=False, config='DEFAULT',
             dataformat=None, extension='.csv', srm_identifier='STD',
             cmap=None, time_format=None, internal_standard='Ca43',
             names='file_names', srm_file=None)

Specify internal_standard during ratio stage (#35), not during import.

Stage: Calibration

Parameters:

  • drift_correct - check box (default = checked)
  • srms_used - scroll list with check-boxes, populated from srm database file.
  • zero_intercept - check box (default = checked)
  • n_min - integer (default = 10)

Extra:

  • option in menu bar to reload srm database?

Pass parameters to method of analyse instance

calibrate(self, analytes=None, drift_correct=True,
          srms_used=['NIST610', 'NIST612', 'NIST614'],
          zero_intercept=True, n_min=10)

Stage Option Definitions

  • data Load
  • despiking
  • autorange
  • background correctoin
  • ratio
  • calibration
  • filtering?
  • export

Also:

Think about 'apply to' option for early analysis stages (e.g. despiking)

Cross-Plot panel

Panel to display cross-plots.

Should be pop-up, as won't fit well in current layout (requires square window, which would displace everything).

Needs to work at both analysis and single-sample level. I can help work this out.

  • Create panel (talk to #3)
  • Display crossplots at whole-analysis and sample level (be able to switch between)

Stage: Ratio

  • internal_standard - drop down, populated from available analytes.

Pass arguments to method of analyse instance:

ratio(self, internal_standard=None, focus='bkgsub')

Stage: Background

Background Correction

There are 2 stages: bkg_calc and bkg_subtract

Background Calculation

  • method : drop-down containing ['bkg_calc_weightedmean', 'bkg_calc_interp1d']

options populate depending on which method is chosen.

bkg_calc_interp1d:

  • kind - integer (default = 1)
  • n_min - integer (default = 10)
  • n_max - integer (optional, default = blank)

bkg_calc_weightedmean:

  • weight_fwhm - float (optional, default = blank)
  • n_min - integer (default = 20)
  • n_max - integer (optional, default = blank)

Universal options (for both):

  • cstep - float (optional, defauly = blank)
  • bkg_filter - check box (default = unchecked)
    If bkg_filter is checked, two more options:
  • f_win - integer (default = 7)
  • f_n_lim - integer (default = 3)

After all options are completed:

  • Button saying 'calculate background'
  • Button to plot background in popup.

Arguments passed to one of two methods in the analyse instance:

bkg_calc_interp1d(self, analytes=None, kind=1, n_min=10, n_max=None, cstep=None,
                      bkg_filter=False, f_win=7, f_n_lim=3)

bkg_calc_weightedmean(self, analytes=None, weight_fwhm=None,
                          n_min=20, n_max=None, cstep=None,
                          bkg_filter=False, f_win=7, f_n_lim=3)

Background Subtraction

  • button to subtract background

Arguments passed to method of analyse instance:

bkg_subtract(self, analytes=None, errtype='stderr', focus='despiked')

Data Import Panel

Data import interface at splash screen.

Need to be able to specify all options in the __init__ of latools.analyse.

Needs to be able to handle:

  • Folder of csv files.
  • 'Reproduce' export (currently a file and folder, moving to a zip file soon).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.