pyani.pyani_report module

Module providing functions for presenting analysis/db output.

pyani.pyani_report.colour_coverage(series: pandas.core.series.Series, threshold: float = 0.95, colour: str = '#FF2222') → List[str][source]

Highlight percent coverage over a threshold.

Parameters:
  • series
  • threshold – float, threshold for cell highlighting
  • colour – str, hex colour for highlighted cells
pyani.pyani_report.colour_identity(series: pandas.core.series.Series, threshold: float = 0.95, colour: str = '#FF2222') → List[str][source]

Highlight percentage identities over a threshold.

Parameters:
  • series
  • threshold – float, threshold for cell highlighting
  • colour – str, hex colour for highlighted cells
pyani.pyani_report.colour_numeric(val: float, threshold: float = 0.95, colour: str = '#FF2222') → str[source]

Highlight numeric values over a threshold.

Parameters:
  • val
  • threshold – float, threshold for cell highlighting
  • colour – str, hex colour for highlighted cell
pyani.pyani_report.colour_rows(series: pandas.core.series.Series, even_colour: str = '#DDECF5', odd_colour: str = '#6CB6E4') → List[str][source]

Return alternating colours for rows in a dataframe.

Parameters:
  • series – pd.Series
  • even_colour – str, hex colour for even rows
  • odd_colour – str, hex colour for odd rows
pyani.pyani_report.header_font() → Dict[str, Any][source]

Return header HTML font style.

pyani.pyani_report.hover_highlight(hover_colour: str = '#FFFF99') → Dict[str, Any][source]

Return HTML style to colour dataframe row when hovering.

Parameters:hover_colour – str, hex colour for hover highlight
pyani.pyani_report.table_padding() → Dict[str, Any][source]

Return HTML for table cell padding.

pyani.pyani_report.write_dbtable(dfm: pandas.core.frame.DataFrame, path: pathlib.Path, formats: Sequence[str] = ('tab', ), show_index: bool = True, colour_num: bool = False) → None[source]

Write database result table to output file in named format.

Parameters:
  • dfm – pd.Dataframe
  • path – Path to output file
  • formats – tuple of str, output file formats
  • show_index – output row and column labels
  • colour_num – use colours for values in HTML output

colours are used for identity/coverage tables

pyani.pyani_report.write_styled_html(path: pathlib.Path, dfm: pandas.core.frame.DataFrame, index: Optional[str] = None, colour_num: bool = False) → None[source]

Add CSS styling to a dataframe and write as HTML.

Parameters:
  • path – path to write output file
  • dfm – dataframe to be written out
  • index – column to be set as index (if necessary)
pyani.pyani_report.write_to_stdout(stem: str, dfm: pandas.core.frame.DataFrame, show_index: bool = False, line_width: float = None) → None[source]

Write dataframe in tab-separated form to STDOUT.

Parameters:
  • stem – str
  • dfm – pd.Dataframe
  • show_index – Boolean, include index in output table
  • line_width