Package transsys :: Class TranssysProgram
[hide private]
[frames] | no frames]

Class TranssysProgram

source code

object --+
         |
        TranssysProgram

Class to represent a transsys program.

References to objects within the transsys program can in some places either be specified by a python reference, or alternatively by a string specifying the name of the object being referred to. The process of replacing these names with proper python references is called resolving, and hence a transsys program in which objects are referred to by proper python references is said to be resolved, whereas one in which references are specified by "raw" strings is said to be unresolved.

Note: unresolved_copy returns a TranssysProgram instance, also for classes derived from TranssysProgram. If unresolved_copy for such classes is required to return the derived class, these classes will have to re-implement this method.

Instance Methods [hide private]
 
__init__(self, name, factor_list=None, gene_list=None, resolve=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
Render the transsys program as a multi-line string.
source code
 
num_factors(self)
Return the number of factors in this transsys program.
source code
 
num_genes(self)
Return the number of genes in this transsys program.
source code
 
factor_names(self)
Return a list of names of the factors in this transsys program.
source code
 
gene_names(self)
Return a list of names of the genes in this transsys program.
source code
int
find_factor_index(self, f_name)
Find the index of factor f_name.
source code
Factor
find_factor(self, f_name)
Find the factor specified by f_name.
source code
int
find_gene_index(self, g_name)
Find the index of gene g_name.
source code
Gene
find_gene(self, g_name)
Find the gene specified by g_name.
source code
 
check_uniqueness(self)
Verify that factor and gene names are unique.
source code
 
resolve(self)
The resolve() method replaces all gene and factor specifications by strings with references to the gene object or factor object, respectively.
source code
 
unresolved_copy(self)
Produce an unresolved transsys program equal to this program itself
source code
TranssysProgram
get_knockout_copy(self, gene_name)
Construct a copy of this transsys program with the specified gene deleted (knocket out).
source code
 
getDecayValueNodes(self)
Get all constant value nodes pertaining to decay attributes in factors.
source code
 
getDiffusibilityValueNodes(self)
Get all constant value nodes pertaining to diffusibility attributes in factors.
source code
 
getFactorValueNodes(self, decayNodes=True, diffusibilityNodes=True)
Get all constant value nodes pertaining to factors in this transsys program.
source code
 
getConstitutiveValueNodes(self)
Get all constant value nodes pertaining to constitutive promoter elements in this transsys program.
source code
 
getActivateSpecValueNodes(self)
Get all constant value nodes pertaining to aspec in activate promoter elements in this transsys program.
source code
 
getActivateMaxValueNodes(self)
Get all constant value nodes pertaining to amax in activate promoter elements in this transsys program.
source code
 
getRepressSpecValueNodes(self)
Get all constant value nodes pertaining to aspec in repress promoter elements in this transsys program.
source code
 
getRepressMaxValueNodes(self)
Get all constant value nodes pertaining to amax in repress promoter elements in this transsys program.
source code
 
getGeneValueNodes(self, constitutiveNodes=True, linkNodes=True)
Get all constant value nodes pertaining to genes in this transsys program.
source code
 
getValueNodes(self)
Get all constant value nodes in this transsys program.
source code
 
getFactorIdentifierNodes(self)
Get all identifier nodes pertaining to factors in this transsys program.
source code
 
getGeneIdentifierNodes(self)
Get all identifier nodes pertaining to genes in this transsys program.
source code
 
getIdentifierNodes(self)
Get all identifier nodes in this transsys program.
source code
 
encoding_gene_list(self, factor_name)
return a list of all genes which encode factor named factor_name
source code
 
write_dot(self, f, dot_parameters)
write transsys program as graph in the dot language
source code
 
dot_positions_circle(self, x0, y0, radius)
Set the dot language coordinates of genes to arrange them in a circle.
source code
 
regulated_genes(self, factor)
Find the genes regulated by factor.
source code
 
indegree_list(self)
Get a gene-based list of indegree values.
source code
 
outdegree_list(self)
Get a gene-based list of outdegree values.
source code
 
merge(self, other)
Merge the factors and genes of transsys program other into this program.
source code
 
canonicalise(self)
Replace values in numeric nodes with the canonical value.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Instance Variables [hide private]
list of strings comments
list of strings that will be provided as comments upon converting the transsys program to a string
list of Factor instances factor_list
list containing the factors of the program
list of Gene instances gene_list
list containing the genes of the program
string name
name of the transsys program
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, factor_list=None, gene_list=None, resolve=True)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Render the transsys program as a multi-line string.

Parsing this string results in a transsys program equal to this instance itself.

Overrides: object.__str__

find_factor_index(self, f_name)

source code 

Find the index of factor f_name.

Returns: int
the index of factor f_name, or -1 if no factor with that name exists

find_factor(self, f_name)

source code 

Find the factor specified by f_name.

Returns: Factor
the requested factor
Raises:
  • StandardError - if the specified factor does not exist

find_gene_index(self, g_name)

source code 

Find the index of gene g_name.

Returns: int
the index of gene g_name, or -1 if no gene with that name exists

find_gene(self, g_name)

source code 

Find the gene specified by g_name.

Returns: Gene
the requested gene
Raises:
  • StandardError - if the specified gene does not exist

check_uniqueness(self)

source code 

Verify that factor and gene names are unique.

This method raises an exception if problems are found and has no useful return value.

Raises:
  • StandardError - if duplicate factor or gene names found

resolve(self)

source code 

The resolve() method replaces all gene and factor specifications by strings with references to the gene object or factor object, respectively. Strings which do not properly resolve trigger an exception. resolve() should be called whenever alterations are done to a TranssysProgram instance in which strings are used to specify genes or factors. Only after resolving, gene names and factor names can be altered without changing the network.

get_knockout_copy(self, gene_name)

source code 

Construct a copy of this transsys program with the specified gene deleted (knocket out).

Notice that this method does not modify the instance on which it is invoked. This is not a mutator method.

Parameters:
  • gene_name (String) - the name of the gene to be knocked out
Returns: TranssysProgram
the transsys program with the gene knocked out

canonicalise(self)

source code 

Replace values in numeric nodes with the canonical value.

Canonicalisation clips values that are outside of their range with the closest value within the range. This does not alter the dynamical properties of the transsys program, as such clipping is done by the transsys engine during simulation of dynamics too.

In other words, the clipping done by the transsys gene expression simulator engine implies that there exist multiple transsys programs with identical dynamics, and canonicalisation serves to reduce this degeneracy by converting such multiple equivalent programs to one canonical form.

Canonicalisation only operates on constant values in certain contexts, see canonicalise documentation for Factor and Gene for more details. Notice that this implies that transsys programs may have identical dynamics even though their canonical forms differ.