summon.matrix
index
/home/raz/projects/summon/lib/summon/matrix.py

SUMMON - Matrix module
 
Include base class for matrices, functions for reading several matrix 
formats, and base classes for matrix visualizations.

 
Modules
       
atexit
summon.colors
itertools
math
summon.matrixlib
summon.multiwindow
random
summon.shapes
summon
summon_core
summon.sumtree
sys
threading
time
summon.treelib
summon.util
summon.vector

 
Classes
       
__builtin__.object
MatrixViewer
DenseMatrixViewer
summon.SummonMenu(summon.Menu)
MatrixMenu
summon.util.Dict(__builtin__.dict)
Matrix

 
class DenseMatrixViewer(MatrixViewer)
    Matrix visualization specifically for dense matrices stored as a 
list of lists
 
 
Method resolution order:
DenseMatrixViewer
MatrixViewer
__builtin__.object

Methods defined here:
__init__(self, data, colormap=None, rlabels=None, clabels=None, cutoff=-inf, rperm=None, cperm=None, rpart=None, cpart=None, style='quads', **options)
setDenseMatrix(self, data, colormap=None, rlabels=None, clabels=None, cutoff=-inf, rperm=None, cperm=None, rpart=None, cpart=None)
sets a new dense matrix to visualize

Methods inherited from MatrixViewer:
closeLabelWindows(self)
close down label windows
closeTreeWindows(self)
close down tree windows
drawBorder(self, nrows, ncols)
draws the matrix boarder
drawLabels(self)
draws matrix labels
drawMatrix(self, mat, mouseClick=None)
drawPartitions(self, mat)
draws cluster partitions
onClick(self, row, col, i, j, val)
default callback for mouse clicks
openLabelWindows(self)
startup label windows
openTreeWindows(self)
startup tree windows
redraw(self)
setLabelWindows(self, show=True)
sets whether label windows are visible
setMatrix(self, mat)
setTreeWindows(self, show=True)
sets whether tree windows are visible
show(self)
shows the visualization window
toggleLabelWindows(self)
rotates through (no labels, inline, and panels)
togglePartitions(self, enabled=None)
toggles the drawing of partition lines
toggleTreeWindows(self)
toggle tree windows

Data and other attributes inherited from MatrixViewer:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'MatrixViewer' objects>
list of weak references to the object (if defined)

 
class Matrix(summon.util.Dict)
    
Method resolution order:
Matrix
summon.util.Dict
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self)
from2DList = from_dmat(self, mat, cutoff=-inf)
from_dmat(self, mat, cutoff=-inf)
Initialize matrix from a 2D list
setup(self, nrows=None, ncols=None, nnz=None, rowsample=False, colsample=False)
submatrix(self, rows=None, cols=None)
Returns a submatrix

Methods inherited from summon.util.Dict:
__getitem__(self, i)
has_keys(self, *keys)
write(self, out=<open file '<stdout>', mode 'w'>)

Data and other attributes inherited from summon.util.Dict:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Dict' objects>
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class MatrixMenu(summon.SummonMenu)
    summatrix popup menu
 
 
Method resolution order:
MatrixMenu
summon.SummonMenu
summon.Menu
__builtin__.object

Methods defined here:
__init__(self, viewer)

Methods inherited from summon.Menu:
add_entry(self, text, func)
add_item(self, item)
add_submenu(self, text, submenu)
add_toggle(self, text, func, state=False)
clear(self)
clears all menu items
delete(self)
delete all the resources of the menu
get_item(self, index)
insert_entry(self, index, text, func)
insert_item(self, index, item)
insert_submenu(self, index, text, submenu)
remove(self, index)
removes a menu item at position 'index'
set_entry(self, index, text, func)
set_item(self, index, item)
set_submenu(self, index, text, submenu)

Data and other attributes inherited from summon.Menu:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Menu' objects>
list of weak references to the object (if defined)

 
class MatrixViewer(__builtin__.object)
    Base class for Matrix Visualizations
 
  Methods defined here:
__init__(self, mat=None, onClick=None, bgcolor=(0, 0, 0), drawzeros=False, style='points', showLabels=False, showLabelWindows=False, winsize=(400, 400), title='summatrix', rtree=None, ctree=None, useTreeLens=(False, False), showTreeWindows=None)
closeLabelWindows(self)
close down label windows
closeTreeWindows(self)
close down tree windows
drawBorder(self, nrows, ncols)
draws the matrix boarder
drawLabels(self)
draws matrix labels
drawMatrix(self, mat, mouseClick=None)
drawPartitions(self, mat)
draws cluster partitions
onClick(self, row, col, i, j, val)
default callback for mouse clicks
openLabelWindows(self)
startup label windows
openTreeWindows(self)
startup tree windows
redraw(self)
setLabelWindows(self, show=True)
sets whether label windows are visible
setMatrix(self, mat)
setTreeWindows(self, show=True)
sets whether tree windows are visible
show(self)
shows the visualization window
toggleLabelWindows(self)
rotates through (no labels, inline, and panels)
togglePartitions(self, enabled=None)
toggles the drawing of partition lines
toggleTreeWindows(self)
toggle tree windows

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'MatrixViewer' objects>
list of weak references to the object (if defined)

 
Functions
       
getDrawColor(bgcolor=(0, 0, 0))
load_dmat(dmat, mat, loadvals=False, minval=-inf, sample=False, rowsample=False, colsample=False)
Load dense matrix
load_matrix(nrows, ncols, nnz, imat, mat, loadvals=False, minval=-inf, sample=False, rowsample=False, colsample=False, format='unknown', filename=None)
Load matrix from an index matrix iterator
open_matrix(filename, mat, loadvals=True, minval=-inf, sample=False, rowsample=False, colsample=False, format='unknown')
Reads a compressed row matrix file
part2perm(part)
Convert a partition to a simple permutation
process_lmat(infile, mat, filename=None)
Processes an lmat so that it returns as an imat
set_perm_from_part(mat, rows=True, cols=True)