oscarbranson / latools_gui Goto Github PK
View Code? Open in Web Editor NEWGUI for LAtools
GUI for LAtools
Tweak the behaviour of pane resizing when the window is resized.
Control panel for statistic calculation and data export.
Features:
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.
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:
After background subtraction, this option is no longer appropriate, as later stages of analysis have to be based on the background corrected data.
The stage of analysis should be passed as a focus_stage
variable to each of the appropriate functions.
Some of these functions don't currently accept a focus_stage
argument. Follow oscarbranson/latools#19 for progress on this issue.
Everything has to be documented!!
Both on the user-facing side, and the back end (so I can maintain the software!)
Ideas:
Pop up to visualise calculated background.
Interacts with latools.analyse
.
File
Configuration
Control panel for Despiking.
Needs to be able to handle all arguments of latools.despike
Create blank templates for all elements of the GUI, which can be populated with controls for each stage of analysis.
Templates needed for:
All templates must be documented and well-commented.
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.
.data['focus_stage']
..analytes
, and assign unique colours.tplot
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.
Control panel for calibration.
Needs to handle all arguments to analyse.calibrate
.
Unsure how feasible this is with GUIs, but if possible:
Docstrings in the numpy format need to be included for every module, class, and function that we have already created. In future these docstrings should be created as you work, so that we aren't left with a big pile of documentation work near the end.
Numpy format: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard
Filtering control panel.
Must be able to:
Control panel to choose denominator analyte and calculate ratios.
Needs to deal with all arguments to latools.ratio
Control panel for Autorange function.
Needs to handle all arguments of latools.autorange
Data displayed in the plot should update as processing is 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()
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?
Have the graph instantly update when settings are changed (current sample, visible elements, etc)
Two sub-panes ('boxes?'), one for each depsiker.
Check box at top of pane, with options underneath
Box 1:
Box 2:
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
New Project (define name)
Open Project
Recent projects dropdown
Link to online manual
Create labels for plot items, or make it so the user can hover over them to display info.
Get them to appear again
[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!]
Import
De-spiking
Autorange
Background
Ratio
Calibration
Filtering
total_counts
)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)
Need to have some way of handling autorange failures. Let's talk about this later
Make it so that the created external graph live updates with the main graph.
Swap current sample
Switch current stage
Update function changes the graph's state based off arguments
UI buttons are able to interact and update the Graph object
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
There should be three package types for final distribution
Options that need to be implemented in the Data Import Stage:
latools.cfg
.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.
Control panel for background calculation and correction.
Needs to offer both latools.bkg_calc_weightedmean
and latools.bkg_calc_interp1d
, and offer different arguments depending on choice.
Parameters:
Extra:
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)
Think about 'apply to' option for early analysis stages (e.g. despiking)
Create legend in graph widget that displays elements and their colours.
Have scroll bar if elements goes beyond the window
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.
Pass arguments to method of analyse
instance:
ratio(self, internal_standard=None, focus='bkgsub')
Pop-up displaying calibration plot.
Similar to existing calibration_plot
.
Combine frameworks developed by Simon and Zane & Ilya into a comprehensive framework.
There are 2 stages: bkg_calc and bkg_subtract
options populate depending on which method is chosen.
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)
Arguments passed to method of analyse
instance:
bkg_subtract(self, analytes=None, errtype='stderr', focus='despiked')
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.