# Path: snakemakelib/report/utils.py
# class Template(string.Formatter):
#     _suffix = {'-3':('n', 10**(-9)), '-2':('u', 10**(-6)), '-1':('m', 10**(-3)), '0':('', 1), '1':('k', 10**3), '2':('M', 10**6), '3':('G', 10**9), '4':('T', 10**12), '5':('P', 10**15)}
#     def format_field(self, value, spec):
#         sfx = ""
#         if spec.endswith('h'):
#             if not value == 0:
#                 spec = spec[:-1] + 'f'
#                 n = (math.floor(math.log(value,10) / 3))
#                 value = value / self._suffix[str(n)][1]
#                 sfx = self._suffix[str(n)][0]
#             else:
#                 spec = 'd'
#         return super(Template, self).format_field(value, spec) + sfx


import os
import sys
import re
import csv
import texttable as tt
import collections
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from snakemakelib.report.utils import Template
from pylab import *
    """
    if data is None:
        return ""
    else:
        tab_tt = tt.Texttable()
        tab_tt.set_precision(2)
        if not header is None:
            data[0] = header
        w = [len(c) + 2 for c in data[0]]
        for r in data:
            for i in range(0, len(r)):
                w[i] = max(w[i], len(r[i]) + 2)
        tab_tt.add_rows(data)
        tab_tt.set_cols_width(w)
        tab_tt.set_cols_align("r" * len(data[0]))
        if indent:
            return _indent_texttable_for_rst(tab_tt)
        else:
            return tab_tt.draw()

class DataFrame(object):
    """Light weight data frame object

    A data frame is represented as an OrderedDict.


    Args:
      *args: if provided, must be a list of lists that upon initialization is converted to an OrderedDict. The first list is treated as a header.
    """
    _format = collections.OrderedDict()

# Path: snakemakelib/report/utils.py
# class Template(string.Formatter):
#     _suffix = {'-3':('n', 10**(-9)), '-2':('u', 10**(-6)), '-1':('m', 10**(-3)), '0':('', 1), '1':('k', 10**3), '2':('M', 10**6), '3':('G', 10**9), '4':('T', 10**12), '5':('P', 10**15)}
#     def format_field(self, value, spec):
#         sfx = ""
#         if spec.endswith('h'):
#             if not value == 0:
#                 spec = spec[:-1] + 'f'
#                 n = (math.floor(math.log(value,10) / 3))
#                 value = value / self._suffix[str(n)][1]
#                 sfx = self._suffix[str(n)][0]
#             else:
#                 spec = 'd'
#         return super(Template, self).format_field(value, spec) + sfx


# Path: snakemakelib/report/picard.py
import os
import sys
import re
import csv
import texttable as tt
import collections
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from snakemakelib.report.utils import Template
from pylab import *

    """
    if data is None:
        return ""
    else:
        tab_tt = tt.Texttable()
        tab_tt.set_precision(2)
        if not header is None:
            data[0] = header
        w = [len(c) + 2 for c in data[0]]
        for r in data:
            for i in range(0, len(r)):
                w[i] = max(w[i], len(r[i]) + 2)
        tab_tt.add_rows(data)
        tab_tt.set_cols_width(w)
        tab_tt.set_cols_align("r" * len(data[0]))
        if indent:
            return _indent_texttable_for_rst(tab_tt)
        else:
            return tab_tt.draw()

class DataFrame(object):
    """Light weight data frame object

    A data frame is represented as an OrderedDict.


    Args:
      *args: if provided, must be a list of lists that upon initialization is converted to an OrderedDict. The first list is treated as a header.
    """
    _format = collections.OrderedDict()

    _tp = Template()