3.2. LAVEnder

3.2.1. Report class: rnftools.lavender.Report

class rnftools.lavender.Report.Report(name, title=None, description='', allowed_delta=5, bam_dirs=None, panels=None, default_x_run=(1e-05, 1.0), default_y_run=(60, 100), default_pdf_size_cm=(10, 10), default_svg_size_px=(640, 640), render_pdf_method='any', keep_intermediate_files=False, compress_intermediate_files=True, default_x_axis='({m}+{w})/({M}+{m}+{w})', default_x_label='FDR in mapping {{/:Italic(#wrongly mapped reads / #mapped reads)}} ', gp_style_func=<function _default_gp_style_func>)[source]

Bases: object

Class for an entire report.

Parameters:
  • name (str) – Name of the report (name of output file and dir).
  • title (str) – Title of the report (if None, then name is used).
  • description (str) – Description of the report.
  • bam_dirs (list of str) – Directories with BAM files (this option is mutually exclusive with the ‘panels’ option).
  • panels (list of dicts) – Advanced configuration for panels (list of dictionaries with the following keys: ‘bam_dir’ (mandatory); ‘panel_dir’, ‘name’, ‘title’ (optional)).
  • allowed_delta (int) – Tolerance of difference of coordinates between true (i.e., expected) alignment and real alignment (very important parameter!).
  • default_x_run ((float,float)) – Range for x-axis in GnuPlot plots.
  • default_y_run ((float,float)) – Range for y-axis in GnuPlot plots.
  • default_pdf_size_cm ((float,float)) – Legacy parameter (does not have any effect).
  • default_svg_size_px ((int,int)) – Size of SVG picture.
  • render_pdf_method (str) – Method for svg42pdf to render PDF (None / ‘any’ (default) / ‘cairo’ / ‘reportlab’ / ‘inkscape’ / ‘imagemagick’ / ‘wkhtmltopdf’).
  • keep_intermediate_files (bool) – Keep files created in intermediate steps during evaluation.
  • compress_intermediate_files (bool) – Compress files created in intermediate steps during evaluation.
  • default_x_axis (str) – Values on x-axis, e.g., “({m}+{w})/({M}+{m}+{w})”.
  • default_x_label (str) – Label on x-axis.
  • gp_style_func (function(i, nb)) – Function assigning GnuPlot styles for overall graphs. Arguments: i: 0-based id of curve, nb: number of curves.
add_graph(y, x_label=None, y_label='', title='', x_run=None, y_run=None, svg_size_px=None, key_position='bottom right')[source]

Add a new graph to the overlap report.

Parameters:
  • y (str) – Value plotted on y-axis.
  • x_label (str) – Label on x-axis.
  • y_label (str) – Label on y-axis.
  • title (str) – Title of the plot.
  • x_run ((float,float)) – x-range.
  • y_run ((int,int)) – y-rang.
  • svg_size_px ((int,int) – Size of SVG image in pixels.
  • key_position (str) – GnuPlot position of the legend.
clean()[source]

Remove all temporary files.

create_html()[source]

Create HTML report.

get_panels()[source]

Get all contained panels.

get_report_dir()[source]

Get directory report’s auxiliary files.

html_fn()[source]

Get name of the HTML file of the report.

3.2.2. Panel class: rnftools.lavender.Panel

class rnftools.lavender.Panel.Panel(report, bam_dir, panel_dir, name, title, render_pdf_method, keep_intermediate_files, compress_intermediate_files, default_x_axis, default_x_label, gp_style_func=<function _default_gp_style_func>)[source]

Bases: object

Class for a single panel in a HTML report.

Parameters:
  • report (rnftools.lavender.Report) – The owner report.
  • bam_dir (str) – Directory to the BAM files for this panel.
  • panel_dir (str) – Directory with auxiliary files for this panel.
  • name (str) – Name of the panel (used for CSS, etc.).
  • title (str) – Title of the panel (to be displayed).
  • render_pdf_method (str) – Method for svg42pdf to render PDF (None / ‘any’ / ‘cairo’ / ‘reportlab’ / ‘inkscape’ / ‘imagemagick’ / ‘wkhtmltopdf’).
  • keep_intermediate_files (bool) – Keep files created in intermediate steps during evaluation.
  • compress_intermediate_files (bool) – Compress files created in intermediate steps during evaluation.
  • default_x_axis (str) – Values on x-axis, e.g., “({m}+{w})/({M}+{m}+{w})”.
  • default_x_label (str) – Label on x-axis.
  • gp_style_func (function(i, nb)) – Function assigning GnuPlot styles for overall graphs. Arguments: i: 0-based id of curve, nb: number of curves.
Raises:

ValueError

create_gp()[source]

Create GnuPlot file.

create_graphics()[source]

Create images related to this panel.

create_tar()[source]

Create a tar file with all the files.

get_bams()[source]

Get BAMs for this panel.

get_html_column()[source]

Get a HTML column for this panel.

get_panel_dir()[source]

Get the directory with panel’s auxiliary files.

get_report()[source]

Get the report.

get_required_files()[source]

Get all required files.

gp_fn()[source]

Get the GnuPlot file name for the overall graphs.

svg_fns()[source]

Get the PDF file names for the overall graphs (empty list if they are not rendered).

tar_fn()[source]

Get the TAR file name for the archive with data.

3.2.3. BAM class: rnftools.lavender.Bam

class rnftools.lavender.Bam.Bam(panel, bam_fn, name, render_pdf_method, keep_intermediate_files, compress_intermediate_files, default_x_axis, default_x_label)[source]

Bases: object

Class for a BAM file.

Parameters:
  • panel (rnftools.lavender.Panel) – Panel containing this BAM file.
  • bam_fn (str) – BAM filename.
  • name (str) – Name for this report.
  • keep_intermediate_files (bool) – Keep files created in intermediate steps during evaluation.
  • render_pdf_method (str) – Method for svg42pdf to render PDF (None / ‘any’ / ‘cairo’ / ‘reportlab’ / ‘inkscape’ / ‘imagemagick’ / ‘wkhtmltopdf’).
  • compress_intermediate_files (bool) – Compress files created in intermediate steps during evaluation.
  • default_x_axis (str) – Values on x-axis, e.g., “({m}+{w})/({M}+{m}+{w})”.
  • default_x_label (str) – Label on x-axis.
static bam2es(bam_fn, es_fo, allowed_delta)[source]

Convert BAM file to ES file.

Parameters:
  • bam_fn (str) – File name of the BAM file.
  • bam_fo (file) – File object of the ES file.
  • allowed_delta (int) – Maximal allowed coordinates difference for correct reads.
bam_fn()[source]

Get name of the BAM file.

create_es()[source]

Create an ES (intermediate) file for this BAM file. This is the function which asses if an alignment is correct

create_et()[source]

Create a et file for this BAM file (mapping information about read tuples).

raises: ValueError

create_gp()[source]

Create a GnuPlot file for this BAM file.

create_graphics()[source]

Create images related to this BAM file using GnuPlot.

create_html()[source]

Create a HTML page for this BAM file.

create_roc()[source]

Create a ROC file for this BAM file.

raises: ValueError

static es2et(es_fo, et_fo)[source]

Convert ES to ET.

Parameters:
  • es_fo (file) – File object for the ES file.
  • et_fo (file) – File object for the ET file.
es_fn()[source]

Get name of the es file.

static et2roc(et_fo, roc_fo)[source]

ET to ROC conversion.

Parameters:
  • et_fo (file) – File object for the ET file.
  • roc_fo (file) – File object for the ROC file.

raises: ValueError

et_fn()[source]

Get name of the et file.

get_name()[source]

Get name associated with the BAM.

get_required_files()[source]

Get names of all files required to complete the report.

gp_fn()[source]

Get name of the GP file.

html_fn()[source]

Get name of the HTML report.

pdf_fn()[source]

Get name of the SVG file.

roc_fn()[source]

Get name of the ROC file.

svg_fn()[source]

Get name of the SVG file.