3.2. LAVEnder¶
Contents
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.
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
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.
-
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
-
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.