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

Class GraphData

source code

object --+
         |
        GraphData

Graph Data.

Attributes:
Instance Methods [hide private]
 
__init__(self, id=None, data=None, name=None, style='bar', color=Color(.564706,.933333,.564706,1), altcolor=Color(.560784,.737255,.545098,1), center=None, colour=None, altcolour=None)
Initialize.
source code
 
set_data(self, data)
Add data as a list of (position, value) tuples.
source code
 
get_data(self)
Return data as a list of sorted (position, value) tuples.
source code
 
add_point(self, point)
Add a single point to the set of data as a (position, value) tuple.
source code
 
quartiles(self)
Return (minimum, lowerQ, medianQ, upperQ, maximum) values as tuple.
source code
 
range(self)
Return range of data as (start, end) tuple.
source code
 
mean(self)
Return the mean value for the data points (float).
source code
 
stdev(self)
Return the sample standard deviation for the data (float).
source code
 
__len__(self)
Return the number of points in the data set.
source code
 
__getitem__(self, index)
Return data value(s) at the given position.
source code
 
__str__(self)
Return a string describing the graph data.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, id=None, data=None, name=None, style='bar', color=Color(.564706,.933333,.564706,1), altcolor=Color(.560784,.737255,.545098,1), center=None, colour=None, altcolour=None)
(Constructor)

source code 

Initialize.

Arguments:
  • id Unique ID for the graph
  • data List of (position, value) tuples
  • name String describing the graph
  • style String describing the presentation style ('bar', 'line', 'heat')
  • color colors.Color describing the color to draw all or the 'high' (some styles) values (overridden by backwards compatible argument with UK spelling, colour).
  • altcolor colors.Color describing the color to draw the 'low' values (some styles only) (overridden by backwards compatible argument with UK spelling, colour).
  • center Value at which x-axis crosses y-axis.
Overrides: object.__init__

range(self)

source code 

Return range of data as (start, end) tuple.

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

__getitem__(self, index)
(Indexing operator)

source code 

Return data value(s) at the given position.

Given an integer representing position on the sequence returns a float - the data value at the passed position.

If a slice, returns graph data from the region as a list or (position, value) tuples. Slices with step are not supported.

__str__(self)
(Informal representation operator)

source code 
Return a string describing the graph data.
Overrides: object.__str__