def test_make_html_file(self):
        """The HTML file is generated in the correct place"""
        data = self.list_data_multiple_plots[0]
        data1 = self.list_data_multiple_plots[1]

        png_img_fp = path.join(self.output_dir, data[LD_NAME] + '.png')
        eps_gz_fp = path.join(self.output_dir, data[LD_NAME] + '.eps.gz')
        png_img_fp1 = path.join(self.output_dir, data1[LD_NAME] + '.png')
        eps_gz_fp1 = path.join(self.output_dir, data1[LD_NAME] + '.eps.gz')
        overlib_fp = path.join(self.output_dir, 'overlib.js')

        self._paths_to_clean_up = [png_img_fp, eps_gz_fp, png_img_fp1,
            eps_gz_fp1, overlib_fp, self.html_fp]
        self._dirs_to_clean_up = [self.output_dir]

        mkdir(self.output_dir)

        make_html_file(self.list_data_multiple_plots, self.mapping_data,
            self.html_fp, self.output_dir)

        self.assertTrue(path.exists(png_img_fp),
            'The png file was not created in the appropiate location')
        self.assertTrue(path.exists(eps_gz_fp),
            'The eps file was not created in the appropiate location')
        self.assertTrue(path.exists(png_img_fp1),
            'The png file was not created in the appropiate location')
        self.assertTrue(path.exists(eps_gz_fp1),
            'The eps file was not created in the appropiate location')
        self.assertTrue(path.exists(overlib_fp),
            'The overlib.js file was not copied in the appropiate location')
        self.assertTrue(path.exists(self.html_fp),
            'The html file was not created in the appropiate location')
Ejemplo n.º 2
0
def make_distance_matrix_heatmap(dm_lines, mapping_lines, html_fp, output_dir):
    """Create an html with a heatmap of the distance matrix

    Inputs:
        dm_lines: distance matrix open file object
        mapping_lines: mapping open file object
        html_fp: filepath of the output html file
        output_dir: path of the output directory which will contain the aux
            html files
    """
    # Parse input files
    data = generate_data_make_html(dm_lines)
    mapping_data = parse_mapping_file_to_dict(mapping_lines)
    # Create the html file
    make_html_file([data], mapping_data, html_fp, output_dir)
def make_beta_significance_heatmap(beta_significance_fp, mapping_fp, html_fp,
                                   output_dir):
    """Creates an html file with the heatmaps of beta significance analysis
    
    Inputs:
        beta_significance_fp: beta significance results filepath
        mapping_fp: mapping filepath
        html_fp: output html filepath
        output_dir: output directory where the aux html files will be stored
    """
    bs_lines = open(beta_significance_fp, 'U')

    l_data = generate_data_make_html(bs_lines)

    mapping_data = parse_mapping_file_to_dict(open(mapping_fp, 'U'))

    make_html_file(l_data, mapping_data, html_fp, output_dir)
def make_beta_significance_heatmap(beta_significance_fp, mapping_fp, html_fp,
    output_dir):
    """Creates an html file with the heatmaps of beta significance analysis
    
    Inputs:
        beta_significance_fp: beta significance results filepath
        mapping_fp: mapping filepath
        html_fp: output html filepath
        output_dir: output directory where the aux html files will be stored
    """
    bs_lines = open(beta_significance_fp, 'U')

    l_data = generate_data_make_html(bs_lines)

    mapping_data = parse_mapping_file_to_dict(open(mapping_fp, 'U'))

    make_html_file(l_data, mapping_data, html_fp, output_dir)
Ejemplo n.º 5
0
    def test_make_html_file(self):
        """The HTML file is generated in the correct place"""
        data = self.list_data_multiple_plots[0]
        data1 = self.list_data_multiple_plots[1]

        png_img_fp = path.join(self.output_dir, data[LD_NAME] + '.png')
        eps_gz_fp = path.join(self.output_dir, data[LD_NAME] + '.eps.gz')
        png_img_fp1 = path.join(self.output_dir, data1[LD_NAME] + '.png')
        eps_gz_fp1 = path.join(self.output_dir, data1[LD_NAME] + '.eps.gz')
        overlib_fp = path.join(self.output_dir, 'overlib.js')

        self._paths_to_clean_up = [
            png_img_fp, eps_gz_fp, png_img_fp1, eps_gz_fp1, overlib_fp,
            self.html_fp
        ]
        self._dirs_to_clean_up = [self.output_dir]

        mkdir(self.output_dir)

        make_html_file(self.list_data_multiple_plots, self.mapping_data,
                       self.html_fp, self.output_dir)

        self.assertTrue(
            path.exists(png_img_fp),
            'The png file was not created in the appropiate location')
        self.assertTrue(
            path.exists(eps_gz_fp),
            'The eps file was not created in the appropiate location')
        self.assertTrue(
            path.exists(png_img_fp1),
            'The png file was not created in the appropiate location')
        self.assertTrue(
            path.exists(eps_gz_fp1),
            'The eps file was not created in the appropiate location')
        self.assertTrue(
            path.exists(overlib_fp),
            'The overlib.js file was not copied in the appropiate location')
        self.assertTrue(
            path.exists(self.html_fp),
            'The html file was not created in the appropiate location')