BiBench: a framework for biclustering tasks.
Classes for represting biclusters, and some utility functions for dealing with common bicluster tasks, like IO.
A class for representing biclusters.
Get a numpy array bicluster from data, using the indices in bic_indices.
Note: requires that this Bicluster’s data member is not None.
Returns the difference of two biclusters.
A Bicluster instance with self’s rows and columns, but not other’s.
If other and self have the same data attribute, the returned Bicluster also has it; else its data attribute is None.
Returns the dataset with only the columns from this bicluster.
Note: requires that this Bicluster’s data member is not None.
Returns the dataset with only the rows from this bicluster.
Note: requires that this Bicluster’s data member is not None.
Returns a new bicluster with common rows and columns.
A Bicluster instance, with rows and columns common to both self and other.
If other and self have the same data attribute, the returned Bicluster also has it; else its data attribute is None.
Returns True if self’s rows and columns are both subsets of other’s; else False.
Returns a new bicluster with only unique rows and columns, i.e. the inverse of the intersection.
A Bicluster instance with all rows and columns unique to either self or other.
If other and self have the same data attribute, the returned Bicluster also has it; else its data attribute is None.
Returns a new bicluster with union of rows and columns.
A Bicluster instance with all rows and columns from both self and other.
If other and self have the same data attribute, the returned Bicluster also has it; else its data attribute is None.
Bases: list
A list of biclusters with three extra attributes:
Decorator to automatically set ‘alg’ and ‘args’ attribute of results of a biclustering algorithm.
Removes duplicates, small biclusters, overlapping biclusters, and biclusters that are as large as the dataset from a list.
biclusters: a list of biclusters to filter.
min_rows: the minimum allowed number of rows.
min_cols: the minimum allowed number of columns.
a float between 0 and 1.
biclusters.
data: use if bicluster.data is None.
Returns the row x number and col x number matrices for the given set of biclusters.
Requires that ‘data’ member be set and equal for all biclusters.
The tuple (rowmatrix, colmatrix), where rowmatrix has dimensions m by len(biclusters) and colmatrix has dimensions n by len(biclusters), where the dataset has m rows and n columns.
Element rowmatrix[x, y] is 1 if row x is in bicluster y, else it is zero. Element colmatrix[x, y] is 1 if column x is in bicluster y, else zero.
Bootstrap a new dataset, of any size, from the given dataset, with replacement.
Takes a dictionary containing lists. Generates all combinations of values from those lists.
Useful for ranges of parameters for functions.
>>> [i for i in dict_combinations(dict(first=[1,2]))]
[{'first': 1}, {'first': 2}]
Flatten a list of lists into a single list.
>>> flatten([[1, 2, 3], [4, 5, 6]])
[1, 2, 3, 4, 5, 6]
Get the BiBench cache directory, and create it if necessary.
Iterate over a list in chunks. From ‘http://stackoverflow.com/questions/434287/what-is-the-most-pythonic-way-to-iterate-over-a-list-in-chunks‘
>>> list(grouper([1, 2, 3, 4], 3, 'x'))
[(1, 2, 3), (4, 'x', 'x')]
Check for an executable on the PATH; return its absolute path.
Taken from http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python