# Path: metatlas/io/write_utils.py
# def make_dir_for(file_path):
# def check_existing_file(file_path, overwrite=False):
# def export_dataframe(dataframe, file_path, description, overwrite=False, **kwargs):
# def raise_on_diff(dataframe, file_path, description, **kwargs):
# def export_dataframe_die_on_diff(dataframe, file_path, description, overwrite=False, **kwargs):


import logging
import numpy as np
from textwrap import wrap
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import collections as mc
from scipy.interpolate import interp1d
from six.moves import range
from six.moves import zip
from metatlas.io import write_utils
                self.ax.annotate(l, xy, ha='right', va='center', size = 8./(num_rows+.25))

        # Y-scale label
        self.y_scale_coordinates = np.matmul(tso_transform,
                                  self.__make_y_scale_coordinates(is_subplot)
                                 )[:,0:2].transpose(0,2,1)
        for subplot_xy in self.y_scale_coordinates:
            for xy in subplot_xy:
                self.ax.annotate('1E%d'%int(self.intensity_scale), xy, ha='right', va='bottom', size = 8./(num_rows+.25), weight='bold')

        # Titles
        title_coordinates = np.matmul(tso_transform,
                                  self.__make_title_coordinates(is_subplot)
                                 )[:,0:2].transpose(0,2,1)

        for i,subplot_xy in enumerate(title_coordinates):
            if not isinstance(self.compound_eics[i], str):
                self.ax.annotate('\n'.join(wrap(self.compound_eics[i].file_name,48)),
                                 subplot_xy[0], ha='center', va='bottom', size = 8./(num_cols+.25), weight='bold')

        # Groups
        if self.group:
            group_label_coordinates = boxes = np.matmul(tso_transform,
                                                        self.__make_group_label_coordinates(is_subplot)
                                                        )[:,0:2].transpose(0,2,1)
            for i,subplot_xy in enumerate(group_label_coordinates):
                if isinstance(self.compound_eics[i], str):
                    self.ax.annotate(self.compound_eics[i],
                                     subplot_xy[0], ha='center', va='center', size = 100./(num_cols+.25), weight='bold')


# Path: metatlas/io/write_utils.py
# def make_dir_for(file_path):
# def check_existing_file(file_path, overwrite=False):
# def export_dataframe(dataframe, file_path, description, overwrite=False, **kwargs):
# def raise_on_diff(dataframe, file_path, description, **kwargs):
# def export_dataframe_die_on_diff(dataframe, file_path, description, overwrite=False, **kwargs):


# Path: metatlas/plots/chromplotplus.py
import logging
import numpy as np
from textwrap import wrap
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import collections as mc
from scipy.interpolate import interp1d
from six.moves import range
from six.moves import zip
from metatlas.io import write_utils

                self.ax.annotate(l, xy, ha='right', va='center', size = 8./(num_rows+.25))

        # Y-scale label
        self.y_scale_coordinates = np.matmul(tso_transform,
                                  self.__make_y_scale_coordinates(is_subplot)
                                 )[:,0:2].transpose(0,2,1)
        for subplot_xy in self.y_scale_coordinates:
            for xy in subplot_xy:
                self.ax.annotate('1E%d'%int(self.intensity_scale), xy, ha='right', va='bottom', size = 8./(num_rows+.25), weight='bold')

        # Titles
        title_coordinates = np.matmul(tso_transform,
                                  self.__make_title_coordinates(is_subplot)
                                 )[:,0:2].transpose(0,2,1)

        for i,subplot_xy in enumerate(title_coordinates):
            if not isinstance(self.compound_eics[i], str):
                self.ax.annotate('\n'.join(wrap(self.compound_eics[i].file_name,48)),
                                 subplot_xy[0], ha='center', va='bottom', size = 8./(num_cols+.25), weight='bold')

        # Groups
        if self.group:
            group_label_coordinates = boxes = np.matmul(tso_transform,
                                                        self.__make_group_label_coordinates(is_subplot)
                                                        )[:,0:2].transpose(0,2,1)
            for i,subplot_xy in enumerate(group_label_coordinates):
                if isinstance(self.compound_eics[i], str):
                    self.ax.annotate(self.compound_eics[i],
                                     subplot_xy[0], ha='center', va='center', size = 100./(num_cols+.25), weight='bold')


        write_utils.check_existing_file(self.file_name, self.overwrite)