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

Class RandomTranssysParameters

source code

object --+
         |
        RandomTranssysParameters

A factory for generating "random" transsys programs. The name "RandomTranssysParameters" really is a historical accident, this class started out as a dumb class with just a bunch of member variables for conveniently storing an ever growing bunch of parameters for random program generation. But finally, the implementation of classes for the transsys program components has permitted writing a reasonable generate_program() method.

Usage of this class: Instantiate with a random seed. Set the member variables by direct assignment as you see fit. Finally, call generate_program() to pull out endless variations of transsys programs...

Instance Methods [hide private]
 
__init__(self, rndseed=1)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
display transsys program generation parameters in a string, in a format that can later on be loaded into a RandomTranssysParameter instance using the parse() method.
source code
 
write(self, f)
write the transsys program generation parameters in file f, in a format that can later on be loaded into a RandomTranssysParameter instance using the parse() method.
source code
 
parse(self, f)
set parameter members by parsing from file f.
source code
 
set_seed(self, rndseed=1) source code
 
get_seed(self) source code
 
set_constitutive(self, v) source code
 
set_km_activation(self, v) source code
 
set_km_repression(self, v) source code
 
set_vmax_activation(self, v) source code
 
set_vmax_repression(self, v) source code
 
set_decay(self, v) source code
 
set_diffusibility(self, v) source code
 
check_linklist(self) source code
 
num_genes(self) source code
 
num_links(self) source code
 
write_parameter_comments(self, f) source code
 
generate_transsys(self, name)
Generate a random transsys program.
source code

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

Class Variables [hide private]
  savefile_magic = 'RandomTranssysParameters-1.1'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, rndseed=1)
(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 

display transsys program generation parameters in a string, in a format that can later on be loaded into a RandomTranssysParameter instance using the parse() method.

Important note: The state of the RandomTranssysParameters instance is not completely represented; the RNG state as well as the current value positions in the CyclicSequence instances are lost. Reproducible transsys generation after parsing a saved file should work if __str__() is used before generating any programs, and if no fancy tricks with CyclicSequence instances are played.

Overrides: object.__str__

write(self, f)

source code 

write the transsys program generation parameters in file f, in a format that can later on be loaded into a RandomTranssysParameter instance using the parse() method.

Important note: The state of the RandomTranssysParameters instance is not completely saved; the RNG state as well as the current value positions in the CyclicSequence instances are lost. Reproducible transsys generation after parsing a saved file should work if write() is used before generating any programs, and if no fancy tricks with CyclicSequence instances are played.

parse(self, f)

source code 

set parameter members by parsing from file f. This should work with files generated by the write() method, but of course, files can also be manually written.

Notes on the format: The format is of the simple <identifier>: <value> type. All parameters must be specified in the order in which they are written by the write() method. Permuting this order was deliberately not permitted because that would make it more easy to omit parameters, and more difficult to check against this. Incomplete specifications are considered dangerous because unspecified parameters may end up in unclear defaults or even undefined states, so it's best to require explicit specification of all parameters.

generate_transsys(self, name)

source code 

Generate a random transsys program. A large variety of parameters controlling the "random" generation of the transsys program can be set in the RandomTranssysParameters instance rtp passed as the third argument to this function.