Package Bio :: Package Graphics :: Package GenomeDiagram :: Module _Graph :: Class GraphData
[hide private]
[frames] | no frames]

Class GraphData

source code

GraphData

Provides:

Methods:

o __init__(self, id=None, data=None, name=None, style='bar',
         color=colors.lightgreen, altcolor=colors.darkseagreen)
         Called on instantiation

o set_data(self, data)  Load the object with data to be plotted

o get_data(self)    Returns the data to be plotted as a list of
                    (position, value) tuples

o add_point(self, point)    Add a single point to the data set

o quartiles(self)   Returns a tuple of the data quartiles

o range(self)   Returns a tuple of the base range covered by the graph
                data

o mean(self)    Returns a float of the mean data point value

o stdev(self)   Returns the sample standard deviation of the data values

o __len__(self) Returns the length of sequence covered by the data

o __getitem__(self, key)    Returns the value at the base specified

o __getslice__(self, low, high) Returns graph data in the base range
                specified

o __str__(self) Returns a formatted string describing the graph data

Attributes:

o id    Unique identifier for the data

o data  Dictionary of describing the data, keyed by position

o name  String describing the data

o style String ('bar', 'heat', 'line') describing how to draw the data

o poscolor     colors.Color for drawing high (some styles) or all
                values

o negcolor     colors.Color for drawing low values (some styles)

o linewidth     Int, thickness to draw the line in 'line' styles

Instance Methods [hide private]
 
__init__(self, id=None, data=None, name=None, style='bar', color=colors.lightgreen, altcolor=colors.darkseagreen)
o id Unique ID for the graph
source code
 
_set_centre(self, value) source code
 
set_data(self, data)
o data List of (position, value) tuples
source code
[(int, float), (int, float), ...]
get_data(self)
Return data as a list of sorted (position, value) tuples
source code
 
add_point(self, point)
o point (position, value) tuple
source code
(float, float, float, float, float)
quartiles(self)
Returns the (minimum, lowerQ, medianQ, upperQ, maximum) values as a tuple
source code
(int, int)
range(self)
Returns the range of the data, i.e.
source code
Float
mean(self)
Returns the mean value for the data points
source code
Float
stdev(self)
Returns the sample standard deviation for the data
source code
Int
__len__(self)
Returns the number of points in the data set
source code
Float
__getitem__(self, key)
o key Integer representing position on the sequence
source code
[(int, float), (int, float), ...]
__getslice__(self, low, high)
o low The start point for the data range
source code
""
__str__(self)
Returns a string describing the graph data
source code
Properties [hide private]
  centre
Backwards compatible alias for center (OBSOLETE)
Method Details [hide private]

__init__(self, id=None, data=None, name=None, style='bar', color=colors.lightgreen, altcolor=colors.darkseagreen)
(Constructor)

source code 
o id    Unique ID for the graph

o data  List of (position, value) tuples

o name  String describing the graph

o style String describing the presentation style ('bar', 'line',
        'heat')

o color   colors.Color describing the color to draw all or the
          'high' (some styles) values (overridden by backwards
          compatible argument with UK spelling, colour).

o altcolor colors.Color describing the color to draw the 'low'
           values (some styles only) (overridden by backwards
           compatible argument with UK spelling, colour).

o center Value at which x-axis crosses y-axis (overridden by
         backwards comparible argument with UK spelling, centre).

set_data(self, data)

source code 

o data List of (position, value) tuples

Add data with a list of (position, value) tuples

add_point(self, point)

source code 

o point (position, value) tuple

Add a single point to the set of data

range(self)

source code 

Returns the range of the data, i.e. its start and end points on the genome as a (start, end) tuple

Returns: (int, int)

__getitem__(self, key)
(Indexing operator)

source code 

o key Integer representing position on the sequence

Returns the data value at the passed position

Returns: Float

__getslice__(self, low, high)
(Slicling operator)

source code 

o low The start point for the data range

o high The end point for the data range

Returns a slice of the graph data from the passed low to the passed high value as a list of (position, value) tuples

Returns: [(int, float), (int, float), ...]

Property Details [hide private]

centre

Backwards compatible alias for center (OBSOLETE)

Get Method:
unreachable(self)
Set Method:
_set_centre(self, value)