Example #1
0
 def test_iqtree_convert_raw_ancestral_states_to_fasta(self):
     iqtree = treebuilders.IQTree(1, model = 'GTRGAMMA')
     iqtree.convert_raw_ancestral_states_to_fasta(os.path.join(data_dir, 'iqtree_ancestral.state'),
                                                  os.path.join(data_dir, 'iqtree_ancestral.fasta.actual'))
     assert filecmp.cmp(os.path.join(data_dir, 'iqtree_ancestral.fasta.actual'),
                        os.path.join(data_dir, 'iqtree_ancestral.fasta.expected'))
     os.remove(os.path.join(data_dir, 'iqtree_ancestral.fasta.actual'))
Example #2
0
 def test_iqtree_treebuilding_command(self):
     iqtree = treebuilders.IQTree(8)
     iqtree.executable = 'DDD'
     iqtree.tree_building_parameters = ['EEE']
     assert iqtree.tree_building_command(
         'AAA', '', 'CCC') == 'DDD EEE -s AAA -pre CCC -nt 8 -quiet'
     iqtree.verbose = True
     iqtree.threads = 0
     assert iqtree.tree_building_command(
         'AAA', 'BBB', 'CCC') == 'DDD EEE -s AAA -pre CCC -nt AUTO -t BBB'
Example #3
0
 def test_transfer_internal_node_labels_to_tree(self):
     reconstructor = treebuilders.IQTree(1, "internal_")
     common.transfer_internal_node_labels_to_tree(
         'gubbins/tests/data/source_tree.tre',
         'gubbins/tests/data/destination_tree.tre',
         'gubbins/tests/data/renamed_output_tree', reconstructor)
     assert os.path.exists('gubbins/tests/data/renamed_output_tree')
     assert filecmp.cmp('gubbins/tests/data/renamed_output_tree',
                        'gubbins/tests/data/expected_renamed_output_tree',
                        shallow=False)
     os.remove('gubbins/tests/data/renamed_output_tree')
Example #4
0
 def test_transfer_internal_node_labels_to_tree(self):
     reconstructor = treebuilders.IQTree(1,
                                         model='GTRGAMMA',
                                         internal_node_prefix='internal_')
     common.transfer_internal_node_labels_to_tree(
         os.path.join(data_dir, 'source_tree.tre'),
         os.path.join(data_dir, 'destination_tree.tre'),
         os.path.join(data_dir, 'renamed_output_tree'), reconstructor)
     assert os.path.exists(os.path.join(data_dir, 'renamed_output_tree'))
     assert filecmp.cmp(os.path.join(data_dir, 'renamed_output_tree'),
                        os.path.join(data_dir,
                                     'expected_renamed_output_tree'),
                        shallow=False)
     os.remove(os.path.join(data_dir, 'renamed_output_tree'))
Example #5
0
 def test_iqtree_replace_internal_node_label(self):
     iqtree = treebuilders.IQTree(8, 'AAA')
     assert iqtree.replace_internal_node_label('Node20') == 'AAA20'
Example #6
0
 def test_iqtree_sequence_reconstruction_command(self):
     iqtree = treebuilders.IQTree(8)
     iqtree.executable = 'DDD'
     iqtree.internal_sequence_reconstruction_parameters = ['EEE']
     assert iqtree.internal_sequence_reconstruction_command('AAA', 'BBB', 'CCC') \
            == 'DDD EEE -s AAA -pre CCC -nt 8 -te BBB -quiet'
Example #7
0
 def test_iqtree_replace_internal_node_label(self):
     iqtree = treebuilders.IQTree(1, model = 'GTRGAMMA', internal_node_prefix='AAA')
     assert iqtree.replace_internal_node_label('Node20') == 'AAA20'