__caspo__ Package

BooleanFamily Module

class __caspo__.BooleanFamily.BooleanFamily(setup, conjunctions, gtts)[source]

Bases: set

Parameters:
>>> from __caspo__ import Conjunction, BooleanFamily, Setup
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> cs = [Conjunction.from_str('TNFa=Hsp27'), Conjunction.from_str('TNFa=p38')]
>>> family = BooleanFamily(setup, cs, False)
>>> len(family)
0
add(model)[source]

Adds a Boolean model to the family. Updates conjunction’s occurrences and GTTs. If the model has the input-output behavior of some previously added model, it’s added to the corresponding GTT. Otherwise, a new GTT is created with this model.

Parameters:model__caspo__.BooleanModel instance to add
>>> from __caspo__ import Conjunction, BooleanFamily, Setup, BooleanModel
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> c1 = Conjunction.from_str('TNFa=Hsp27')
>>> c2 = Conjunction.from_str('TNFa=ras')
>>> c3 = Conjunction.from_str('ras=Hsp27')
>>> c4 = Conjunction.from_str('TNFa=p38')
>>> cs = [c1, c2, c3, c4]
>>> family = BooleanFamily(setup, cs, True)
>>> len(family)
0
>>> len(family.gtts)
0

First, we add a model having only c1 and since the family is empty, a new GTT is created.

>>> family.add(BooleanModel([c1]))
>>> len(family)
1
>>> len(family.gtts)
1

Next, we add a model having c2 and c3 which is equivalent to the previous model.

>>> family.add(BooleanModel([c2,c3]))
>>> len(family)
2
>>> len(family.gtts)
1

Finally, if we add a model having a different input-output behavior, a new GTT is created.

>>> family.add(BooleanModel([c4]))
>>> len(family)
3
>>> len(family.gtts)
2

Now, let’s check the GTTs and their corresponding gathered models. Note that we convert family.gtts into a list only for testing (sets don’t preserve any order), but you don’t need to do it in your code.

>>> for gtt in sorted(family.gtts):
...     print gtt.vector(), [m.vector() for m in gtt.models]
{'TNFa=Hsp27': 1} [{'TNFa=ras': 1, 'ras=Hsp27': 1}]
{'TNFa=p38': 1} []
combinatorics(mode, update=False)[source]

Returns an iterator over the mutual inclusive/exclusive conjunctions.

Parameters:
  • mode – either ‘exclusive’ or ‘inclusive’
  • update – True to force to re-compute combinatorics.
Returns:

iterator

>>> from __caspo__ import Conjunction, BooleanFamily, Setup, BooleanModel
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> c1 = Conjunction.from_str('TNFa=Hsp27')
>>> c2 = Conjunction.from_str('TNFa=ras')
>>> c3 = Conjunction.from_str('ras=Hsp27')
>>> cs = [c1, c2, c3]
>>> family = BooleanFamily(setup, cs, False)
>>> family.add(BooleanModel([c1]))
>>> family.add(BooleanModel([c2,c3]))
>>> for m in family.combinatorics('exclusive'):
...     print m['conjunction_A'], m['frequency_A'], m['conjunction_B'], m['frequency_B']
TNFa=Hsp27 0.5 TNFa=ras 0.5
TNFa=Hsp27 0.5 ras=Hsp27 0.5
>>> for m in family.combinatorics('inclusive'):
...     print m['conjunction_A'], m['frequency_A'], m['conjunction_B'], m['frequency_B']
ras=Hsp27 0.5 TNFa=ras 0.5
frequencies[source]

Returns an iterator over tuples (h,f) where h is the string representation of a conjunction and f its frequency in the family.

Returns:iterator
>>> from __caspo__ import Conjunction, BooleanFamily, Setup, BooleanModel
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> c1 = Conjunction.from_str('TNFa=Hsp27')
>>> c2 = Conjunction.from_str('TNFa=ras')
>>> c3 = Conjunction.from_str('ras=Hsp27')
>>> c4 = Conjunction.from_str('TNFa=p38')
>>> c5 = Conjunction.from_str('ras=p38')
>>> cs = [c1, c2, c3, c4, c5]
>>> family = BooleanFamily(setup, cs, False)
>>> family.add(BooleanModel([c1]))
>>> family.add(BooleanModel([c2,c3]))
>>> family.add(BooleanModel([c4]))
>>> family.add(BooleanModel([c2,c5]))
>>> print list(family.frequencies)
[('TNFa=Hsp27', 0.25), ('TNFa=ras', 0.5), ('ras=p38', 0.25), ('ras=Hsp27', 0.25), ('TNFa=p38', 0.25)]
classmethod from_matrix(matrix, setup, conjunctions, gtts)[source]

Constructor from a matrix representation of logic models

Parameters:
  • matrix – iterator over rows in the matrix. Each row describes a model
  • setup__caspo__.Setup instance
  • conjunctions – list of all possible __caspo__.Conjunction among the family
  • gtts – True to compute GTTs, False otherwise.
>>> from __caspo__ import Conjunction, BooleanFamily, Setup
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> cs = [Conjunction.from_str('TNFa=Hsp27'), Conjunction.from_str('TNFa=p38')]
>>> matrix = [{'TNFa=Hsp27': '1', 'TNFa=p38': '0'}, {'TNFa=Hsp27': '0', 'TNFa=p38': '1'}]
>>> family = BooleanFamily.from_matrix(matrix, setup, cs, False)
>>> len(family)
2
>>> print list(family.frequencies)
[('TNFa=Hsp27', 0.5), ('TNFa=p38', 0.5)]
classmethod from_termsets(termsets, setup, conjunctions, gtts)[source]

Constructor from a list of PyASP TermSet instances.

Parameters:
Returns:

__caspo__.BooleanFamily

to_matrix()[source]

Returns an iterator over all models in the family as vectors (key-value: conjunction-{0,1})

>>> from __caspo__ import Conjunction, BooleanFamily, Setup, BooleanModel
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> c1 = Conjunction.from_str('TNFa=Hsp27')
>>> c2 = Conjunction.from_str('TNFa=ras')
>>> c3 = Conjunction.from_str('ras=Hsp27')
>>> c4 = Conjunction.from_str('TNFa=p38')
>>> cs = [c1, c2, c3, c4]
>>> family = BooleanFamily(setup, cs, True)
>>> family.add(BooleanModel([c1]))
>>> family.add(BooleanModel([c2,c3]))
>>> family.add(BooleanModel([c2,c3,c4]))
>>> for model in sorted(family.to_matrix(), key=lambda v: v.values().count(1)):
...     print model
{'TNFa=Hsp27': 1, 'TNFa=ras': 0, 'ras=Hsp27': 0, 'TNFa=p38': 0}
{'TNFa=Hsp27': 0, 'TNFa=ras': 1, 'ras=Hsp27': 1, 'TNFa=p38': 0}
{'TNFa=Hsp27': 0, 'TNFa=ras': 1, 'ras=Hsp27': 1, 'TNFa=p38': 1}
weighted_mse(dataset, testing=[])[source]

Compute the weighted MSE of the family. If GTTs were computed, each output prediction is weighted according to the number of models gathered by the corresponding GTT. Otherwise, output predictions are summed over all models in the family. If the family is complete, both computation are equivalent.

Parameters:
>>> from __caspo__ import Conjunction, BooleanFamily, Setup, BooleanModel
>>> setup = Setup(['TNFa'], ['p38'], ['Hsp27', 'p38'])
>>> c1 = Conjunction.from_str('TNFa=Hsp27')
>>> c2 = Conjunction.from_str('TNFa=ras')
>>> c3 = Conjunction.from_str('ras=Hsp27')
>>> c4 = Conjunction.from_str('TNFa=p38')
>>> cs = [c1, c2, c3, c4]
>>> family = BooleanFamily(setup, cs, True)
>>> family.add(BooleanModel([c1]))
>>> family.add(BooleanModel([c2,c3]))
>>> family.add(BooleanModel([c4]))

Now, let’s create a fake dataset and compute the family’s MSE

>>> from __caspo__ import Dataset, Experiment, Conjunction
>>> e0 = Experiment({'TNFa': 1, 'p38': 0}, {10: {'Hsp27':0.8, 'p38': 0}})
>>> e1 = Experiment({'TNFa': 0, 'p38': 1}, {10: {'Hsp27':0.2, 'p38':0}})
>>> dataset = Dataset([e0, e1], ['TNFa'], ['p38'], ['Hsp27', 'p38'], 10)
>>> print "%.4f" % family.weighted_mse(dataset) # ((2/3 - 0.8)^2 + (0 - 0.2)^2) / 4
0.0144

BooleanModel Module

class __caspo__.BooleanModel.BooleanModel(conjunctions)[source]

Bases: object

Parameters:conjunctions – an iterable of __caspo__.Conjunction instances
>>> from __caspo__ import Conjunction, BooleanModel
>>> c1 = Conjunction.from_str('p38+traf6=Hsp27')
>>> c2 = Conjunction.from_str('!AKT=Hsp27')
>>> b = BooleanModel([c1,c2])
>>> b.has_conjunction(c1)
True
>>> b.targets('Hsp27')
True
>>> len(b['Hsp27'])
2
conjunctions[source]

Read-only access to the list of conjunctions in the model

Returns:list
>>> from __caspo__ import Conjunction, BooleanModel, Setup
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b = BooleanModel([c])
>>> [str(c) for c in b.conjunctions]
['TGFa+TNFa=Hsp27']
classmethod from_termset(termset)[source]

Constructor from a PyASP TermSet instance where each term in the TermSet is expected to describe a conjunction.

Parameters:termset – PyASP TermSet of conjunctions
Returns:__caspo__.BooleanModel
>>> from pyasp.asp import TermSet, Term
>>> from __caspo__ import BooleanModel
>>> c1 = Term('conjunction', [Term('set', ['"p38"',1, Term('set', ['"traf6"',1,'nil'])]), 2, '"Hsp27"'])
>>> c2 = Term('conjunction', [Term('set', ['"AKT"',-1, 'nil']), 2, '"Hsp27"'])
>>> b = BooleanModel.from_termset(TermSet([c1,c2]))
>>> [str(c) for c in b['Hsp27']]
['!AKT=Hsp27', 'p38+traf6=Hsp27']
classmethod from_vector(vector)[source]

Constructor from a vector representation

Parameters:vector – A mapping describing key-value pairs like (‘conjunction=target’,{‘0’,‘1’})
Returns:__caspo__.BooleanModel
>>> from __caspo__ import BooleanModel
>>> b = BooleanModel.from_vector({'TNFa=CREB': '0', '!AKT=Hsp27': '1', 'p38+traf6=Hsp27': '1'})
>>> [str(c) for c in b['Hsp27']]
['!AKT=Hsp27', 'p38+traf6=Hsp27']
has_conjunction(conjunction)[source]

Returns whether the conjunction is present or not in the model

Parameters:conjunction__caspo__.Conjunction instance
Returns:bool
>>> from __caspo__ import Conjunction, BooleanModel
>>> c1 = Conjunction.from_str('p38+traf6=Hsp27')
>>> c2 = Conjunction.from_str('!AKT=Hsp27')
>>> c3 = Conjunction.from_str('p38+traf6=Hsp27')
>>> b = BooleanModel([c1])
>>> b.has_conjunction(c1)
True
>>> b.has_conjunction(c2)
False
>>> b.has_conjunction(c3)
True
iteritems()[source]

Proxy to standard iteritems function over mapping objects.

Returns:iterator of key-value pairs like: (target-node, conjunctions list)
mse(dataset, testing=[])[source]

Compute Mean Squared Error with respect to a given dataset

Parameters:
  • dataset – A instance of __caspo__.Dataset
  • testing – Optional list of experiments indices (useful for cross-validation)
Returns:

float

First, we create a fake dataset containing 2 simple experiments

>>> from __caspo__ import Dataset, Experiment, Conjunction, BooleanModel
>>> e0 = Experiment({'TNFa':1}, {10: {'Hsp27':1}})
>>> e1 = Experiment({'TNFa':0}, {10: {'Hsp27':1}})
>>> dataset = Dataset([e0, e1], ['TNFa'], [], ['Hsp27'], 10)

Now, we create a Boolean model and compute its MSE

>>> from __caspo__ import Conjunction, BooleanModel
>>> c = Conjunction.from_str('TNFa=Hsp27')
>>> b = BooleanModel([c])
>>> b.mse(dataset)
0.5
>>> b.mse(dataset, [0])
0.0
>>> b.mse(dataset, [1])
1.0
resolve(node, inputs, setup, visited=[])[source]

Resolve the Boolean value for a node under the given inputs.

Parameters:
  • node – the name of the node to resolve
  • inputs – mapping of node names to bool values describing experimental condition
  • setup__caspo__.Dataset.Setup instance
  • visited – list of already visited nodes in the recursion (for internal use)
Returns:

bool

>>> from __caspo__ import Conjunction, BooleanModel, Setup
>>> setup = Setup(['TNFa', 'TGFa'], [], ['Hsp27'])
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b = BooleanModel([c])
>>> b.resolve('Hsp27', {'TNFa':True, 'TGFa':False}, setup)
False
>>> b.resolve('Hsp27', {'TNFa':True, 'TGFa':True}, setup)
True
targets(node)[source]

Returns whether the given node is a target in the model

Parameters:node – node name
Returns:bool
>>> from __caspo__ import Conjunction, BooleanModel
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b = BooleanModel([c])
>>> b.targets('Hsp27')
True
>>> b.targets('p38')
False
termset(ide=None)[source]

Converts the Boolean model instance to a TermSet instance

Parameters:ide – Optionally, an id can be included as the first argument in the terms describing the logic model
Returns:TermSet
>>> from __caspo__ import Conjunction, BooleanModel
>>> c1 = Conjunction.from_str('p38+traf6=Hsp27')
>>> c2 = Conjunction.from_str('!AKT=Hsp27')
>>> b = BooleanModel([c1,c2])
>>> ts = b.termset()

We have two predicates to describe a logic model: conjunction and in.

>>> conjunctions = [str(c) for c in ts if c.pred() == Conjunction.CONJUNCTION]
>>> print conjunctions 
['conjunction(set("traf6",1,set("p38",1,nil)),2,"Hsp27")', 
 'conjunction(set("AKT",-1,nil),1,"Hsp27")']
>>> ins = [str(c) for c in b.termset() if c.pred() == Conjunction.IN]
>>> print ins 
['in("AKT",-1,set("AKT",-1,nil))', 
 'in("p38",1,set("traf6",1,set("p38",1,nil)))',
 'in("traf6",1,set("traf6",1,set("p38",1,nil)))']         

Sometimes, adding an identifier to the model can be useful (to compute GTTs for example)

>>> tsi = b.termset(1)
>>> conjunctions_with_id = [str(c) for c in tsi if c.pred() == Conjunction.CONJUNCTION]
>>> print conjunctions_with_id 
['conjunction(1,set("traf6",1,set("p38",1,nil)),2,"Hsp27")',
 'conjunction(1,set("AKT",-1,nil),1,"Hsp27")']
vector(v=None)[source]

Converts the Boolean model instance to a vector representation.

Parameters:v – An optional mapping to overwrite.
Returns:dict
>>> from __caspo__ import Conjunction, BooleanModel
>>> c1 = Conjunction.from_str('p38+traf6=Hsp27')
>>> c2 = Conjunction.from_str('!AKT=Hsp27')
>>> b = BooleanModel([c1,c2])
>>> b.vector()
{'!AKT=Hsp27': 1, 'p38+traf6=Hsp27': 1}
>>> v = {'!AKT=Hsp27': 0, 'p38+traf6=Hsp27': 0, 'TNFa=CREB': 0}
>>> b.vector(v)
{'TNFa=CREB': 0, '!AKT=Hsp27': 1, 'p38+traf6=Hsp27': 1}
>>> print v
{'TNFa=CREB': 0, '!AKT=Hsp27': 1, 'p38+traf6=Hsp27': 1}
class __caspo__.BooleanModel.GTT(model)[source]

Bases: __caspo__.BooleanModel.BooleanModel

Parameters:model – Boolean model representing the Global Truth Table
>>> from __caspo__ import Conjunction, BooleanModel, GTT
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b = BooleanModel([c])
>>> g = GTT(b)
>>> len(g)
1
add(model)[source]

Adds a model to the GTT

Parameters:model – the boolean model to add
>>> from __caspo__ import Conjunction, BooleanModel, GTT
>>> c1 = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b1 = BooleanModel([c1])
>>> g = GTT(b)
>>> c2 = Conjunction.from_str('TNFa=p38')
>>> b2 = BooleanModel([c2])
>>> g.add(b2)
>>> len(g)
2
to_matrix(setup)[source]

Returns an iterator over all possible inputs and their corresponding outputs

Parameters:setup__caspo__.Dataset.Setup instance
>>> from __caspo__ import Conjunction, BooleanModel, Setup, GTT
>>> setup = Setup(['TNFa', 'TGFa'], [], ['Hsp27'])
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> gtt = GTT(BooleanModel([c]))
>>> for r in gtt.to_matrix(setup):
...     print r
{'TGFa': 0, 'Hsp27': 0, 'TNFa': 0}
{'TGFa': 0, 'Hsp27': 0, 'TNFa': 1}
{'TGFa': 1, 'Hsp27': 0, 'TNFa': 0}
{'TGFa': 1, 'Hsp27': 1, 'TNFa': 1}

Conjunction Module

class __caspo__.Conjunction.Conjunction(sources, target)[source]

Bases: object

AND = '+'
CONJUNCTION = 'conjunction'
Parameters:
>>> from __caspo__ import Node, Conjunction
>>> c = Conjunction([Node('p38',1), Node('TNFa',-1)], 'Hsp27')
>>> len(c)
2
>>> print c
!TNFa+p38=Hsp27
EQ = '='
IN = 'in'
NIL = 'nil'
SET = 'set'
classmethod from_str(string)[source]

Constructor from a string representation

Parameters:string – string representation of a conjunction
Returns:__caspo__.Conjunction
>>> from __caspo__ import Conjunction
>>> c1 = Conjunction.from_str('p38+traf6=Hsp27')
>>> c2 = Conjunction.from_str('!AKT=Hsp27')
>>> len(c1)
2
>>> len(c2)
1
>>> print [str(s) for s in c1.sources], c1.target
['p38', 'traf6'] Hsp27
>>> print [str(s) for s in c2.sources], c2.target
['!AKT'] Hsp27
classmethod from_term(term)[source]

Constructor from a PyASP Term

Parameters:term – PyASP Term instance
Returns:__caspo__.Conjunction
>>> from pyasp.asp import Term
>>> from __caspo__ import Conjunction
>>> t = Term('conjunction', [Term('set', ['"p38"',1, Term('set', ['"traf6"',1,'nil'])]), 2, '"Hsp27"'])
>>> c = Conjunction.from_term(t)
>>> len(c)
2
>>> print c
p38+traf6=Hsp27
resolve(model, inputs, setup, visited)[source]

Resolve the Boolean value under the given inputs.

Parameters:
  • model__caspo__.BooleanModel instance
  • inputs – mapping of node names to bool values describing experimental condition
  • setup__caspo__.Dataset.Setup instance
  • visited – list of already visited nodes in the recursion (for internal use)
Returns:

bool

>>> from __caspo__ import Conjunction, BooleanModel, Setup
>>> setup = Setup(['TNFa', 'TGFa'], [], ['Hsp27'])
>>> c = Conjunction.from_str('TNFa+TGFa=Hsp27')
>>> b = BooleanModel([c])
>>> c.resolve(b, {'TNFa':True, 'TGFa':False}, setup, [])
False
>>> c.resolve(b, {'TNFa':True, 'TGFa':True}, setup, [])
True
termset(ide=None)[source]

Converts the Conjunction instance to a TermSet instance

Parameters:ide – Optionally, an id can be included as the first argument in the terms describing the conjunction
Returns:TermSet
>>> from __caspo__ import Conjunction
>>> c = Conjunction.from_str('p38+traf6=Hsp27')
>>> ts = c.termset()
>>> conjunctions = [str(c) for c in ts if c.pred() == Conjunction.CONJUNCTION]
>>> print conjunctions 
['conjunction(set("traf6",1,set("p38",1,nil)),2,"Hsp27")']
class __caspo__.Conjunction.Node(name, sign)[source]

Bases: object

NEG = '!'
Parameters:
  • name – node name
  • sign – node sign (-1 or 1)
>>> from __caspo__ import Node
>>> n = Node('p38', 1)
>>> print n
p38
>>> n = Node('p38', -1)
>>> print n
!p38
classmethod from_str(string)[source]

Constructor from a string

Parameters:string – the signed node string representation
Returns:__caspo__.Conjunction.Node
>>> from __caspo__ import Node
>>> n = Node.from_str('!Hsp27')
>>> print n.name
Hsp27
>>> n.sign
-1
>>> n = Node.from_str('Hsp27')
>>> print n.name
Hsp27
>>> n.sign
1

Dataset Module

class __caspo__.Dataset.Dataset(experiments, stimuli, inhibitors, readouts, time_point)[source]

Bases: list

Parameters:
  • experiments – list of __caspo__.Dataset.Experiment instances
  • stimuli – list of stimuli
  • inhibitors – list of inhibitors
  • readouts – list of readouts
  • time_point – default time-point
classmethod from_midas(filepath)[source]

Constructor from MIDAS file

Parameters:filepath – MIDAS filepath
Returns:__caspo__.Dataset.Dataset
termset(factor=100, indices=[])[source]

Returns TermSet representation

Parameters:
  • factor – discretization factor
  • indices – list of indices to include in the termset
Returns:

TermSet

class __caspo__.Dataset.Experiment(inputs, outputs)[source]

Bases: object

Parameters:
  • inputs – key-value mapping describing an experimental condition
  • outputs – key-value mapping describing experimental observations for each time-point
boolean_input(setup)[source]

Return boolean inputs

>>> from __caspo__ import Setup, Experiment
>>> setup = Setup(['TNFa', 'TGFa'], [], ['Hsp27', 'CREB'])
>>> e = Experiment({'TNFa': 1, 'TGFa': 0}, {10: {'Hsp27': 0.2, 'CREB': 0.9}})
>>> e.boolean_input(setup)
{'TGFa': False, 'TNFa': True}
discrete_output(time, factor)[source]

Returns a key-value mapping of discrete observations

Parameters:
  • time – time-point
  • factor – discretization factor
Returns:

dict

>>> from __caspo__ import Experiment
>>> e = Experiment({'TNFa': 1, 'TGFa': 0}, {10: {'Hsp27': 0.2, 'CREB': 0.953}})
>>> e.discrete_output(10, 100)
{'Hsp27': 20, 'CREB': 95}
class __caspo__.Dataset.Setup(stimuli, inhibitors, readouts)[source]

Bases: object

Parameters:
  • stimuli – list of stimuli
  • inhibitors – list of inhibitors
  • readouts – list of readouts
powerset()[source]

Iterator over all possible experimental conditions

Returns:iterator
termset()[source]

Returns TermSet respresentation

Returns:TermSet
>>> from __caspo__ import Setup
>>> setup = Setup(['TNFa', 'TGFa'], [], ['Hsp27', 'CREB'])
>>> setup.termset()
TermSet([Term('stimulus',['"TGFa"']), Term('readout',['"CREB"']), Term('stimulus',['"TNFa"']), Term('readout',['"Hsp27"'])])

Learner Module

class __caspo__.Learner.Learner(pkn, dataset)[source]

Bases: object

Parameters:
learn(fit_tol, size_tol, discrete, gtts=False, learning=[])[source]

Learn logic models

Parameters:
  • fit_tol – fitness tolerance
  • size_tol – size tolerance
  • discrete – multi-valued discretization
  • gtts – compute GTTs
  • learning – indices to use from the dataset
Results :

__caspo__.BooleanFamily.BooleanFamily

validate(fit_tol, size_tol, discrete, times, kfolds)[source]

Run k-fold cross validation

Parameters:
  • fit_tol – fitness tolerance
  • size_tol – size tolerance
  • discrete – multi-valued discretization
  • times – cross validation iterations
  • kfolds – folds for the cross-validation
Returns:

iterator over the results

Network Module

class __caspo__.Network.Network(sif_file)[source]

Bases: object

Parameters:sif_file – SIF filepath
termset()[source]

Returns TermSet

Returns:TermSet

cno Module

__caspo__.cno.compress(pkn, midas)[source]

Compress a PKN with respect to a MIDAS file using CellNOpt. Returns the SIF filepath to the compressed PKN

Parameters:
  • pkn – PKN sif filepath
  • midas – MIDAS filepath
Returns:

string

utils Module

class __caspo__.utils.Profiler[source]

Bases: object

start()[source]
stop()[source]
class __caspo__.utils.Writer(outdir)[source]

Bases: object

write(iterable, filename, header=None, rowmaker=<function <lambda> at 0x10d3ce410>, verbose=True)[source]
__caspo__.utils.clean_up()[source]