Package qubx :: Module modelGTK
[hide private]
[frames] | no frames]

Module modelGTK

source code

Panel which shows an open qub model.

Copyright 2008-2014 Research Foundation State University of New York This file is part of QUB Express.

QUB Express is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QUB Express is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License, named LICENSE.txt, in the QUB Express program directory. If not, see <http://www.gnu.org/licenses/>.

Classes [hide private]
  QubModelView
Displays and edits one qubx.model.QubModel.
  QubModelDefaultTool
Basic mouse interaction for QubModelView.
  QubModelConnectTool
Mouse interaction and overlay while drawing a connection between states.
  QubModelColorTool
Mouse interaction and overlay while picking a state's color.
  QubModelScaleTool
Mouse interaction and overlay while picking a rate to complete a Scale constraint.
  QubModelLoopTool
Mouse interaction and overlay while picking rates around a loop.
  GrabTool
As qubx.dataGTK.QubDataView.tool, lets user highlight data to initialize class Amp/Std/Cond/CondStd.
  QubModelCopyDialog
Modal window with settings for 'copy model image'.
  IeqFvAboutBox
  ModelMerge_Dialog
  ModelNbPicturePrefs
Functions [hide private]
 
distance(x1, y1, x2, y2)
Returns the Euclidean distance between (x1, y1) and (x2, y2).
source code
 
default_static(x)
Returns a function f; every time you call f() it returns x.
source code
 
can_regrab(model) source code
 
pt_in_rect(x, y, r)
Returns True if the point (x, y) is within the rect r=(x0, y0, w, h).
source code
 
FitIeqFv(II, SS, DV, CC, GG, GS, I0, S0)
Finds the baseline current and per-class conductance which best fit current/voltage measurements.
source code
 
ModelMerge(item=None, count_paths=None, merged_name=None) source code
 
CopyModelTree(item) source code
 
PasteModelTree(item) source code
 
PasteNewModel(item) source code
 
iterstim(**stim) source code
 
iter_stim_Pe(modelview, **stim) source code
 
iter_Pe_of_state(modelview, state, **stim) source code
 
iter_Pe_of_class(modelview, cls, **stim) source code
 
calc_Pe_of_stim(modelview, stim, idx, out_name='Peq', calc=<__builtin__.function object>)
Calculates equilibrium probability at various combinations of stimulus.
source code
 
find_ec50(modelview, stim_name, idx, calc=<__builtin__.function object>) source code
Variables [hide private]
  Tools = <qubx.util_types.ToolRegistry object>
  COLOR_STATE_BORDER = ('modelGTK.state.border', (0, 0, 0, 1))
  COLOR_STATE_LABEL = ('modelGTK.state.label', (1, 1, 1, 1))
  COLOR_RATE = ('modelGTK.rate', (0, 0, 0, 1))
  COLOR_EFFECTIVE_RATE = ('modelGTK.rate.effective', (0.5, 0, 0....
  COLOR_BG = ('modelGTK.bg', (1, 1, 0.75, 1))
  COLOR_CHANCOUNT = ('modelGTK.channelCount', (1, 1, 1, 1))
  COLOR_BUTTON = ('modelGTK.button', (0, 0, 0, 0.85))
  COLOR_BUTTON_TEXT = ('modelGTK.button.text', (0.1, 1, 0.1, 0.9))
  COLOR_BUTTON_GRAY = ('modelGTK.button.gray', (1, 1, 1, 0.4))
  COLOR_BUTTON_HOVER = ('modelGTK.button.hover', (1, 0.9, 0.9, 1))
  COLOR_QUESTION_BORDER = ('modelGTK.button.border', (1, 0, 0, 1))
  CLICK_SLOP = 2
  MENU_TIMEOUT = 360
  MENU_STRAYDIUS = 2
  IGNORE_MENU_RELEASE = 5
  TheCopyDialog = <QubModelCopyDialog object at 0x7fd1219bd460 (...
  TheIeqFvAboutBox = <IeqFvAboutBox object at 0x7fd1219bd6e0 (Gt...
  ModelMerge_index = 0
  ALLOW_THREADS = 1
  BUFSIZE = 8192
  CLIP = 0
  ERR_CALL = 3
  ERR_DEFAULT = 521
  ERR_IGNORE = 0
  ERR_LOG = 5
  ERR_PRINT = 4
  ERR_RAISE = 2
  ERR_WARN = 1
  FLOATING_POINT_SUPPORT = 1
  FPE_DIVIDEBYZERO = 1
  FPE_INVALID = 8
  FPE_OVERFLOW = 2
  FPE_UNDERFLOW = 4
  False_ = False
  Inf = inf
  Infinity = inf
  MAXDIMS = 32
  MAY_SHARE_BOUNDS = 0
  MAY_SHARE_EXACT = -1
  MIN_TOTAL_RATE = 1e-09
  NAN = nan
  NINF = -inf
  NZERO = -0.0
  NaN = nan
  PINF = inf
  PZERO = 0.0
  RAISE = 2
  SHIFT_DIVIDEBYZERO = 0
  SHIFT_INVALID = 9
  SHIFT_OVERFLOW = 3
  SHIFT_UNDERFLOW = 6
  ScalarType = (<type 'int'>, <type 'float'>, <type 'complex'>, ...
  True_ = True
  UFUNC_BUFSIZE_DEFAULT = 8192
  UFUNC_PYVALS_NAME = 'UFUNC_PYVALS'
  WRAP = 1
  __package__ = 'qubx'
  absolute = <ufunc 'absolute'>
  add = <ufunc 'add'>
  arccos = <ufunc 'arccos'>
  arccosh = <ufunc 'arccosh'>
  arcsin = <ufunc 'arcsin'>
  arcsinh = <ufunc 'arcsinh'>
  arctan = <ufunc 'arctan'>
  arctan2 = <ufunc 'arctan2'>
  arctanh = <ufunc 'arctanh'>
  bitwise_and = <ufunc 'bitwise_and'>
  bitwise_not = <ufunc 'invert'>
  bitwise_or = <ufunc 'bitwise_or'>
  bitwise_xor = <ufunc 'bitwise_xor'>
  c = (1, 0, 1)
  c_ = <numpy.lib.index_tricks.CClass object>
  cast = {<type 'numpy.bool_'>: <function <lambda> at 0x7fd1396e...
  cbrt = <ufunc 'cbrt'>
  conj = <ufunc 'conjugate'>
  conjugate = <ufunc 'conjugate'>
  deg2rad = <ufunc 'deg2rad'>
  divide = <ufunc 'divide'>
  e = 2.71828182846
  equal = <ufunc 'equal'>
  euler_gamma = 0.577215664902
  exp2 = <ufunc 'exp2'>
  floor_divide = <ufunc 'floor_divide'>
  fmax = <ufunc 'fmax'>
  fmin = <ufunc 'fmin'>
  greater = <ufunc 'greater'>
  greater_equal = <ufunc 'greater_equal'>
  i = 19
  index_exp = <numpy.lib.index_tricks.IndexExpression object>
  inf = inf
  infty = inf
  invert = <ufunc 'invert'>
  isfinite = <ufunc 'isfinite'>
  left_shift = <ufunc 'left_shift'>
  less = <ufunc 'less'>
  less_equal = <ufunc 'less_equal'>
  little_endian = True
  log2 = <ufunc 'log2'>
  logaddexp = <ufunc 'logaddexp'>
  logaddexp2 = <ufunc 'logaddexp2'>
  logical_and = <ufunc 'logical_and'>
  logical_not = <ufunc 'logical_not'>
  logical_or = <ufunc 'logical_or'>
  logical_xor = <ufunc 'logical_xor'>
  maximum = <ufunc 'maximum'>
  mgrid = <numpy.lib.index_tricks.nd_grid object>
  minimum = <ufunc 'minimum'>
  mod = <ufunc 'remainder'>
  multiply = <ufunc 'multiply'>
  nan = nan
  nbytes = {<type 'numpy.bool_'>: 1, <type 'numpy.timedelta64'>:...
  negative = <ufunc 'negative'>
  newaxis = None
hash(x)
  nextafter = <ufunc 'nextafter'>
  not_equal = <ufunc 'not_equal'>
  ogrid = <numpy.lib.index_tricks.nd_grid object>
  pi = 3.14159265359
  power = <ufunc 'power'>
  r_ = <numpy.lib.index_tricks.RClass object>
  rad2deg = <ufunc 'rad2deg'>
  rdbk = 'Expired.'
  rdbreak = 'supporting'
  rdname = 'qubfast.txt'
  reciprocal = <ufunc 'reciprocal'>
  remainder = <ufunc 'remainder'>
  right_shift = <ufunc 'right_shift'>
  rint = <ufunc 'rint'>
  s_ = <numpy.lib.index_tricks.IndexExpression object>
  sctypeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>,...
  sctypeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bo...
  sctypes = {'complex': [<type 'numpy.complex64'>, <type 'numpy....
  sign = <ufunc 'sign'>
  signbit = <ufunc 'signbit'>
  spacing = <ufunc 'spacing'>
  square = <ufunc 'square'>
  subtract = <ufunc 'subtract'>
  true_divide = <ufunc 'true_divide'>
  typeDict = {0: <type 'numpy.bool_'>, 1: <type 'numpy.int8'>, 2...
  typeNA = {'?': 'Bool', 'B': 'UInt8', 'Bool': <type 'numpy.bool...
  typecodes = {'All': '?bhilqpBHILQPefdgFDGSUVOMm', 'AllFloat': ...
Function Details [hide private]

FitIeqFv(II, SS, DV, CC, GG, GS, I0, S0)

source code 

Finds the baseline current and per-class conductance which best fit current/voltage measurements.

Parameters:
  • II - list of current-mean measurements [pA]
  • SS - list of current-standard-deviation measurements [pA]
  • DV - list of (V - Vrev) measurements [Volts]
  • CC - list of the model class of each measurement
  • GG - list of starting values for conductance, per model class [pS]
  • GS - list of starting values for conductance standard deviation [pS]
  • I0 - mean baseline current [pA]
  • S0 - standard deviation of baseline current [pA]
Returns:
(GG, GS, I0, S0) after nonlinear least squares fitting

calc_Pe_of_stim(modelview, stim, idx, out_name='Peq', calc=<__builtin__.function object>)

source code 

Calculates equilibrium probability at various combinations of stimulus.

Parameters:
  • modelview - e.g. QubX.Models.view
  • stim - dict(stim_name -> value or list of values); will evaluate the cartesian product of all values
  • idx - Index of class or state
  • calc - interpret idx as class (default), or as state with calc=iter_Pe_of_state
Returns:
list of dict, with entries for out_name and each stim_name, corresponding to cartesian product of all requested conditions

Variables Details [hide private]

COLOR_EFFECTIVE_RATE

Value:
('modelGTK.rate.effective', (0.5, 0, 0.5, 1))

TheCopyDialog

Value:
<QubModelCopyDialog object at 0x7fd1219bd460 (GtkDialog at 0x2ff2360)>

TheIeqFvAboutBox

Value:
<IeqFvAboutBox object at 0x7fd1219bd6e0 (GtkWindow at 0x30d81a0)>

ScalarType

Value:
(<type 'int'>,
 <type 'float'>,
 <type 'complex'>,
 <type 'long'>,
 <type 'bool'>,
 <type 'str'>,
 <type 'unicode'>,
 <type 'buffer'>,
...

cast

Value:
{<type 'numpy.bool_'>: <function <lambda> at 0x7fd1396ed758>, <type 'n\
umpy.timedelta64'>: <function <lambda> at 0x7fd1396ed7d0>, <type 'nump\
y.float16'>: <function <lambda> at 0x7fd1396ed848>, <type 'numpy.uint8\
'>: <function <lambda> at 0x7fd1396ed8c0>, <type 'numpy.int8'>: <funct\
ion <lambda> at 0x7fd1396ed938>, <type 'numpy.object_'>: <function <la\
mbda> at 0x7fd1396ed9b0>, <type 'numpy.datetime64'>: <function <lambda\
> at 0x7fd1396eda28>, <type 'numpy.uint64'>: <function <lambda> at 0x7\
fd1396edaa0>, <type 'numpy.int64'>: <function <lambda> at 0x7fd1396edb\
...

nbytes

Value:
{<type 'numpy.bool_'>: 1, <type 'numpy.timedelta64'>: 8, <type 'numpy.\
float16'>: 2, <type 'numpy.uint8'>: 1, <type 'numpy.int8'>: 1, <type '\
numpy.object_'>: 8, <type 'numpy.datetime64'>: 8, <type 'numpy.uint64'\
>: 8, <type 'numpy.int64'>: 8, <type 'numpy.void'>: 0, <type 'numpy.co\
mplex256'>: 32, <type 'numpy.float128'>: 16, <type 'numpy.uint64'>: 8,\
 <type 'numpy.int64'>: 8, <type 'numpy.unicode_'>: 0, <type 'numpy.com\
plex128'>: 16, <type 'numpy.float64'>: 8, <type 'numpy.uint32'>: 4, <t\
ype 'numpy.int32'>: 4, <type 'numpy.string_'>: 0, <type 'numpy.complex\
...

sctypeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int64'>,
...

sctypeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'Datetime64': <type 'numpy.datetime64'>,
...

sctypes

Value:
{'complex': [<type 'numpy.complex64'>,
             <type 'numpy.complex128'>,
             <type 'numpy.complex256'>],
 'float': [<type 'numpy.float16'>,
           <type 'numpy.float32'>,
           <type 'numpy.float64'>,
           <type 'numpy.float128'>],
 'int': [<type 'numpy.int8'>, <type 'numpy.int16'>, <type 'numpy.int32\
...

typeDict

Value:
{0: <type 'numpy.bool_'>,
 1: <type 'numpy.int8'>,
 2: <type 'numpy.uint8'>,
 3: <type 'numpy.int16'>,
 4: <type 'numpy.uint16'>,
 5: <type 'numpy.int32'>,
 6: <type 'numpy.uint32'>,
 7: <type 'numpy.int64'>,
...

typeNA

Value:
{'?': 'Bool',
 'B': 'UInt8',
 'Bool': <type 'numpy.bool_'>,
 'Complex128': <type 'numpy.complex256'>,
 'Complex32': <type 'numpy.complex64'>,
 'Complex64': <type 'numpy.complex128'>,
 'D': 'Complex64',
 'Datetime64': <type 'numpy.datetime64'>,
...

typecodes

Value:
{'All': '?bhilqpBHILQPefdgFDGSUVOMm',
 'AllFloat': 'efdgFDG',
 'AllInteger': 'bBhHiIlLqQpP',
 'Character': 'c',
 'Complex': 'FDG',
 'Datetime': 'Mm',
 'Float': 'efdg',
 'Integer': 'bhilqp',
...