forgi.threedee.model.stats module¶
-
class
forgi.threedee.model.stats.
AngleStat
(stat_type='angle', pdb_name='', dim1=0, dim2=0, u=0, v=0, t=0, r1=0, u1=0, v1=0, ang_type='x', define=[], seq='', vres={})[source]¶ Bases:
future.types.newobject.newobject
Class for storing an individual statistic about inter-helical angles.
-
deviation_from
(stat2)[source]¶ How much does the other stat differ from this stat?
Parameters: stat2 – Another AngleStat Returns: A 4-tuple: The positional deviation in Angstrom, and 3 absolute angular deviations in radians. The angular deviations are u, v and t
-
is_similar_to
(stat2, position_cutoff=4, angular_cutoff=None)[source]¶ Returns True, if theAngleStat is similar (according to the specified cutoff) to the other Angle Stat.
Parameters: - position_cutoff – in angstrom
- angular_cutoff – in radians. If not given, uses the position cutoff as a value in degrees
-
orientation_params
()[source]¶ Return a tuple containing the parameters which specify the orientation of one stem with respect to another.
Returns: (u, v)
-
-
class
forgi.threedee.model.stats.
ClusteredAngleStats
(filename)[source]¶ Bases:
future.types.newobject.newobject
A collection of clustered angle_stats. Whenever stats for a certain key are retrieved, only one (randomly choosen) representative per cluster is returned.
Requires a clustered angle stats file (created by fess/scripts/cluster_stats.py). The file should look like this:
‘ # Cluster 0 for (1, 1, -1): angle RS_1788_S_000008_A 1 1 1.520877 1.837257 -1.380352 11.237569 0.867246 2.057771 1 19 19 30 30 UCG CAA # Cluster 1 for (1, 1, -1): angle RS_1140_S_000002_A 1 1 1.563667 1.869580 -0.967966 16.241881 0.896602 2.177000 -1 13 13 24 24 ACG CUU angle RS_1183_S_000008_A 1 1 1.533551 1.914482 -1.108396 15.780723 0.829850 2.255556 -1 4 4 46 46 UAG CAG ‘
Parameters: filename – The filename of the clustered angle stats file.
-
class
forgi.threedee.model.stats.
ConformationStats
(stats_file, clustered_angle_stats_file=None)[source]¶ Bases:
future.types.newobject.newobject
-
class
forgi.threedee.model.stats.
ConstructionStats
[source]¶ Bases:
future.types.newobject.newobject
-
angle_stats
= None¶
-
conf_stats
= None¶
-
fiveprime_stats
= None¶
-
loop_stats
= None¶
-
stem_stats
= None¶
-
threeprime_stats
= None¶
-
-
class
forgi.threedee.model.stats.
FilteredConformationStats
(stats_file, filter_filename=None, filter_prob=1)[source]¶ Bases:
forgi.threedee.model.stats.ConformationStats
Parameters: filter_prob – Return the filtered stats with this probability, else all stats. Default=1 (100%)
-
class
forgi.threedee.model.stats.
LoopStat
(line='', s_type='loop')[source]¶ Bases:
future.types.newobject.newobject
Class for storing the individual statistics about loops.
phys_length: The length between the start and the centroid of the loop.
-
class
forgi.threedee.model.stats.
RandomAngleStats
(discrete_angle_stats)[source]¶ Bases:
future.types.newobject.newobject
Store all of the angle stats.
-
create_random_function
(data)[source]¶ Create a function that returns a random value for each column in the statistics.
Parameters: stats – A table containing n rows and m columns Returns: A function returning m random values with a maximum and minimum no greater than the largest and least values in that column, respectively.
-
-
class
forgi.threedee.model.stats.
StemStat
(line='')[source]¶ Bases:
future.types.newobject.newobject
Class for storing the individual statistics about helices.
Each stem will be defined by its base pair length. Two parameters are associated with each base pair length:
phys_length: The physical length of such a helix twist_angle: The angle between its two twist segments
-
forgi.threedee.model.stats.
get_angle_stat_dims
(s1, s2, angle_type, min_entries=1)[source]¶ Return a list of tuples which indicate the dimensions for which angle stats are avilable.
Parameters: - s1 – The first size
- s2 – The second size
- angle_type – The type of the angle.
- min_entries – The minimum number of stats that have to be available
-
forgi.threedee.model.stats.
get_angle_stats
(filename, refresh=False)[source]¶ Load the statistics about inter the helix-helix orientations from a file.
The file format should be as follows:
angle pdb_name dim1 dim2 r u v t r1 u1 v1 s1b s2b
Where the parameters are as follows:
angle
: identifier for a type of statistics… should always just be ‘angle’pdb_name
: the name of the pdb file these statistics came fromdim1
: the smaller dimension of the bulgedim2
: the larger dimension of the bulgeu
: the polar angle of the orientation of the 2nd stemv
: the azimuth of the orientation of the 2nd stemt
: the orientation of the twist of the second stemr1
: the distance of the start of the 2nd stem helix from the end of the 1st- stem helix
u1
: the polar angle of the separation vector of the two helicesv1
: the azimuth of the separation vector of the two helicess1b
: The side of the first stem closest to the bulges2b
: The side of the second stem closest to the bulge
The azimuth is always defined with respect to the coordinate system defined by the stem1 helix axis vector and it’s twist vector (the one adjacent to the bulge element).
-
forgi.threedee.model.stats.
get_fiveprime_stats
(filename, refresh=False)[source]¶ Load the statistics from the file.
format:
fiveprime pdb_name bp_length phys_length
Parameters: filename – The name of the file.
-
forgi.threedee.model.stats.
get_loop_stats
(filename, refresh=False)[source]¶ Load the statistics from the file.
format:
loop pdb_name bp_length phys_length
Parameters: filename – The name of the file.
-
forgi.threedee.model.stats.
get_stem_stats
(filename, refresh=False)[source]¶ Load the statistics from the file.
format:
stem pdb_name bp_length phys_length twist_angle
Parameters: filename – The name of the file.