def test_make_jackknife_tree_html_file(self):
        """The HTML file is generated in the right place"""
        self._paths_to_clean_up = [self.output_file,
            path.join(self.tmp_dir, 'overlib.js')]
        make_jackknife_tree_html_file(self.jack_tree, self.support,
            self.trans_values, self.mapping_data, self.output_file,
            self.tmp_dir)

        self.assertTrue(path.exists(self.output_file),
            'The html file was not created in the appropiate location')
        self.assertTrue(path.exists(path.join(self.tmp_dir, 'overlib.js')),
            'The javascript file was not moved in the appropiate location')
Esempio n. 2
0
    (0.7, 0.9): ("#82FF8B", "70-90%"),
    (0.9, 0.999): ("#F8FE83", "90-99.9%"),
    (0.999, None): ("#FF8582", "> 99.9%")
}

if __name__ == '__main__':
    option_parser, opts, args = parse_command_line_parameters(**script_info)
    support_fp = opts.support_fp
    tree_fp = opts.tree_fp
    mapping_fp = opts.mapping_fp
    html_fp = opts.output_html_fp
    output_dir = opts.output_dir

    # Create output directory
    try:
        os.mkdir(output_dir)
    except OSError:
        pass

    # Parse jackknife support file
    support = parse_jackknife_support_file(open(support_fp, 'U'))

    # Parse jackknife named nodes tree file
    tree = parse_newick(open(tree_fp, 'U'), PhyloNode)

    # Parse mapping file
    mapping_data = parse_mapping_file_to_dict(open(mapping_fp, 'U'))

    # Generate the html file
    make_jackknife_tree_html_file(tree, support, DICT_TRANS_VALUES,
                                  mapping_data, html_fp, output_dir)