sfa.base module

class sfa.base.Algorithm(abbr)[source]

Bases: sfa.base.ContainerItem

The base class of Algorithm classes.

Examples

>>> class AnAlgorithm(sfa.base.Algorithm):
        # Definition of algorithm ...
        ...
>>> alg = AnAlgorithm()
>>> alg.params = params_obj # Parameters of the algorithm
>>> alg.data = data_obj # Data to be analyzed by the algorithm
>>> alg.initialize()
>>> res = alg.compute()
Attributes
abbrstr

Abbreviation or symbol representing this item.

namestr

Full name or description of this item.

datasfa.base.Data

The object of sfa.base.Data.

paramssfa.base.ParameterSet

The object of sfa.base.ParameterSet.

resultsfa.base.Result

The object of sfa.base.Result.

Methods

compute(self, b)

Process the assigned data

compute_batch(self)

Process the assigned data that contains a batch data.

initialize_basal_activity(self)

Initialize the basal activity, \(b\).

initialize_network(self)

Initialize the data structures related to network.

copy

initialize

compute(self, b)[source]
Process the assigned data

with the given basal activity, \(b\).

Parameters
bnumpy.ndarray

1D array of basal activity.

Returns
xnumpy.ndarray

1D-array object of activity at steady-state.

compute_batch(self)[source]

Process the assigned data that contains a batch data. The result is stored in result member.

copy(self, is_deep=False)[source]
data

The object of sfa.base.Data. Data to be processed based on the algorithm can accessed through this member.

initialize(self, network=True, ba=True)[source]
initialize_basal_activity(self)[source]

Initialize the basal activity, \(b\).

initialize_network(self)[source]

Initialize the data structures related to network.

params

The object of sfa.base.ParameterSet. Parameters of the algorithm can accessed through this member.

result

The object of sfa.base.Result. The result of computing the batch.

class sfa.base.Data[source]

Bases: sfa.base.ContainerItem

Attributes
A
abbr

Abbreviation or symbol representing this item.

df_conds
df_exp
df_ptb
dg
has_link_perturb
i2n
iadj_to_idf
inputs
n2i
name

Full name or description of this item.

names_ptb
vals_ptb

Methods

initialize

A
df_conds
df_exp
df_ptb
dg
i2n
iadj_to_idf
initialize(self, fpath, fname_network='network.sif', fname_ptb='ptb.tsv', fname_conds='conds.tsv', fname_exp='exp.tsv', inputs={})[source]
inputs
n2i
names_ptb
vals_ptb
class sfa.base.Result[source]

Bases: sfa.utils.FrozenClass

Attributes
df_sim
df_sim