Package schrodinger :: Package analysis :: Module enrichment :: Class Plotter
[hide private]
[frames] | no frames]

Class Plotter

object --+
         |
        Plotter


A class to plot multiple series of Calculator data.

API example
-----------
enrich_calc1 = enrichment.Calculator(
    actives_file_name = "my_actives.txt",
    results = "screen_results1.rept",
    num_decoys = 1000
)
enrich_calc2 = enrichment.Calculator(
    actives_file_name = "my_actives.txt",
    results = "screen_results2.rept",
    num_decoys = 1000
)
enrich_plotter = enrichment.Plotter([enrich_calc1, enrich_calc2])
enrich_plotter.plot() # Launch interactive plot window.
enrich_plotter.savePlot('my_plot.png') # Save plot to file. 

There are six line styles defined by default.  Plotting more than
six results cycles through the styles. 

Instance Methods [hide private]
 
__init__(self, calcs, title='Screen Results')
Returns: None
 
plot(self, indexes=None)
Launch interactive matplotlib viewer loaded with plot of the ROC series.
 
savePlot(self, png_file='plot.png')
Serialized figure to a png format file.
 
getPlotFigure(self, indexes=None)
Returns a new pylab figure of a ROC plot: Sensitivity v 1-Specificity,
 
addSeries(self, calc, style=None, plot_figure=None)
Returns: None
 
addReferenceSeries(self, style=None, plot_figure=None)
Returns: None.

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, calcs, title='Screen Results')
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • calcs (list) - List of Calculator instances.
  • title (string) - The plot title.
Returns:
None
Overrides: object.__init__

plot(self, indexes=None)

 

Launch interactive matplotlib viewer loaded with plot of the ROC series.

Parameters:
  • indexes (list) - List of indexes into self.calcs to include in the plot. If the argument is None then all series are plotted.
Returns:
None

savePlot(self, png_file='plot.png')

 

Serialized figure to a png format file.

Parameters:
  • png_file (string) - Path to output png file.
Returns:
None

getPlotFigure(self, indexes=None)

 

Returns a new pylab figure of a ROC plot: Sensitivity v 1-Specificity,

Parameters:
  • indexes (list) - List of indexes into self.calcs to include in the plot. If the argument is None then all series are plotted.
Returns:
Returns a pylab figure.

addSeries(self, calc, style=None, plot_figure=None)

 
Parameters:
  • calc (enrichment.Calculator) - An instance of this module's Calculator class.
  • style (string) - The matplotlib linestyle. If style is None then a style is selected by fetching the next element from self.styles.
  • plot_figure (pylab.Figure) - A pylab figure. If None then the current figure is used.
Returns:
None

addReferenceSeries(self, style=None, plot_figure=None)

 
Parameters:
  • style (string) - The matplotlib linestyle. If style is None then 'k-' is used.
  • plot_figure (pylab.Figure) - A pylab figure. If None then the current figure is used.
Returns:
None. Adds a diagonal representing random performance.