コード例 #1
0
def test_binASC():
	'''This test should pass'''
	HERE = os.path.abspath(os.path.dirname(__file__))
	full_path = os.path.join(HERE, "binASC")
	main.call_main("morphology", '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)




		
コード例 #2
0
def test_mixed():
	'''This test should fail, as we've given PFinder a non-morph model'''
	HERE = os.path.abspath(os.path.dirname(__file__))
	full_path = os.path.join(HERE, "wrongmodel")
	with pytest.raises(util.PartitionFinderError):
		main.call_main("morphology", '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)

	
		
		
コード例 #3
0
def test_clustering(folder_name):
    full_path = os.path.join(HERE, folder_name)
    error, kind, cmdline = test_container[folder_name]
    if error is None:
        main.call_main(kind, '"%s" --raxml %s' % (full_path, cmdline))
    elif type(error) == type((0, 0)):
        pytest.xfail(error[1])
    else:
        with pytest.raises(error):
            main.call_main(kind, '"%s" --raxml %s' % (full_path, cmdline))
コード例 #4
0
def test_model():
	'''This test should pass'''
	HERE = os.path.abspath(os.path.dirname(__file__))
	full_path = os.path.join(HERE, "aictest")
	main.call_main("morphology", '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)
	new_file = os.path.join(full_path, "analysis/best_scheme.txt")
	txt = open(new_file)
	file_obj = txt.readlines()
	for x in file_obj:
		x = x.strip()
		if "1      |" in x:
			x = x.split('|')
			mod = x[1].strip()
			assert mod == 'MULTISTATE+G'
コード例 #5
0
ファイル: test_bic.py プロジェクト: brettc/partitionfinder
def test_bic():
	'''This test should pass'''
	HERE = os.path.abspath(os.path.dirname(__file__))
	full_path = os.path.join(HERE, "bictest")
	main.call_main("morphology", '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)
	new_file = os.path.join(full_path, "analysis/best_scheme.txt")
	txt = open(new_file)
	file_obj = txt.readlines()
	for x in file_obj:
		x = x.strip()
		if "Scheme BIC" in x:
			line = x.split(':')
			numspace = line[1]
			num = numspace.strip()
			num = float(num)
			num = int(num)
			assert num == 2
コード例 #6
0
def test_model_greedy_phyml02(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s"' % path_from_function())
    assert "only works with nucleotide models" in caplog.text()
コード例 #7
0
def test_model_greedy_raxml02(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s" --raxml' % path_from_function())
    assert "Expected ";" (at char 284), (line:9, col:22)" in caplog.text()
コード例 #8
0
from partfinder import main, subset, scheme, config

from pympler.classtracker import ClassTracker
tracker = ClassTracker()
# Plug it in here..
scheme.tracker = tracker

scheme.tracker = tracker
tracker.track_class(subset.Subset)
tracker.track_class(scheme.Scheme)
tracker.create_snapshot()
main.call_main("DNA", "--raxml examples/nucleotide --cmd ' -T 2'")
# main.call_main("DNA", "--raxml Li_2008")
tracker.create_snapshot()
tracker.stats.print_summary()
コード例 #9
0
def test_greedy_phyml_protein():
    main.call_main("protein", '"%s"' % path_from_function())
コード例 #10
0
def test_clustering_phyml_dna(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '--no-ml-tree "%s"' % path_from_function())
    assert "Clustering methods are only available when using raxml" in caplog.text()
コード例 #11
0
def test_quick_analysis(test_folder):
    full_path = os.path.join(HERE, test_folder)
    main.call_main("DNA", "%s --force-restart" % full_path)
コード例 #12
0
def test_prot(prot):
    full_path = os.path.join(HERE, prot)
    main.call_main("protein", '--compare "%s"' % full_path)
コード例 #13
0
def test_greedy_raxml_protein():
    main.call_main("protein", '--no-ml-tree "%s" --raxml' % path_from_function())
コード例 #14
0
def test_multi():
    '''This test should pass'''
    HERE = os.path.abspath(os.path.dirname(__file__))
    full_path = os.path.join(HERE, "multistate")
    main.call_main("morphology",
                   '--min-subset-size 1 --raxml "%s"' % full_path)
コード例 #15
0
def test_dna(dna):
    full_path = os.path.join(HERE, dna)
    main.call_main("DNA", '--compare "%s"' % full_path)
コード例 #16
0
def test_model_greedy_raxml02(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s" --raxml' % path_from_function())
    assert "Expected "
    " (at char 284), (line:9, col:22)" in caplog.text()
コード例 #17
0
def test_model_greedy_raxml01(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s" --raxml' % path_from_function())
    assert "WAG+F' is not a valid model for phylogeny program raxml" in caplog.text(
    )
コード例 #18
0
def test_model_greedy_phyml02(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s"' % path_from_function())
    assert "only works with nucleotide models" in caplog.text()
コード例 #19
0
def test_overlap_error(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("protein", '"%s"' % path_from_function())
    assert "overlaps with previously defined partitions" in caplog.text()
コード例 #20
0
def test_rerun_success(rerun_success):
    full_path = os.path.join(HERE, rerun_success)
    load_rerun(full_path)
    main.call_main("DNA", '"%s"' % full_path)
コード例 #21
0
def test_1subset():
    full_path = os.path.join(HERE, "1subset")
    main.call_main("DNA", '--raxml "%s"' % full_path)
コード例 #22
0
def test_rerun_pf_error(rerun_pf_error):
    full_path = os.path.join(HERE, rerun_pf_error)
    load_rerun(full_path)
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s"' % full_path)
コード例 #23
0
def test_alignment_error(caplog):
    with pytest.raises(alignment.AlignmentError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "Site 1000 is specified in [data_blocks], but the alignment only has 949 sites." in caplog.text()
コード例 #24
0
def test_rerun_analysis_error(rerun_ana_error):
    full_path = os.path.join(HERE, rerun_ana_error)
    load_rerun(full_path)
    with pytest.raises(analysis.AnalysisError):
        main.call_main("DNA", '"%s"' % full_path)
コード例 #25
0
def test_morph_tiger():
    full_path = os.path.join(HERE, "morph_tiger")
    main.call_main("morphology", '--raxml --kmeans tiger --min-subset-size 1 "%s"' % full_path)
コード例 #26
0
def test_rerun_config_error(rerun_conf_error):
    full_path = os.path.join(HERE, rerun_conf_error)
    load_rerun(full_path)
    with pytest.raises(config.ConfigurationError):
        main.call_main("DNA", '"%s"' % full_path)
コード例 #27
0
ファイル: test_pf2.py プロジェクト: brettc/partitionfinder
def test_overlapping_blocks(caplog):
    with pytest.raises(PartitionFinderError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "following sites overlap" in caplog.text()
コード例 #28
0
def test_clustering_raxml_dna():
    main.call_main("DNA", '--no-ml-tree "%s" --raxml' % path_from_function())
コード例 #29
0
def test_greedy_raxml_dna():
    main.call_main("DNA", '"%s" --raxml' % path_from_function())
コード例 #30
0
def test_alignment_error(caplog):
    with pytest.raises(alignment.AlignmentError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "Site 1000 is specified in [data_blocks], but the alignment only has 949 sites." in caplog.text(
    )
コード例 #31
0
def test_overlap_error(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("protein", '"%s"' % path_from_function())
    assert "overlaps with previously defined partitions" in caplog.text()
コード例 #32
0
def test_overlapping_blocks(caplog):
    with pytest.raises(PartitionFinderError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "following sites overlap" in caplog.text()
コード例 #33
0
def test_model_greedy_phyml03(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s"' % path_from_function())
    assert "'WAG+LG+F+I' is not a valid model for phylogeny program phyml" in caplog.text()
コード例 #34
0
def test_missing_sites_warning(caplog):
    main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "These columns are missing from the block definitions" in caplog.text(
    )
コード例 #35
0
def test_model_greedy_raxml03(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s" --raxml' % path_from_function())
    assert "MtArt+I+G+F' is not a valid model for phylogeny program raxml" in caplog.text()
コード例 #36
0
def test_bin():
    '''This test should pass'''
    HERE = os.path.abspath(os.path.dirname(__file__))
    full_path = os.path.join(HERE, "bin_wrongdata")
    main.call_main("morphology",
                   '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)
コード例 #37
0
def test_overlap_error(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "sites overlap in your block definitions" in caplog.text()
コード例 #38
0
def test_grand():
    full_path = os.path.join(HERE, "Grande_2013")
    main.call_main("DNA", '--no-ml-tree --raxml "%s"' % full_path)
コード例 #39
0
def test_clustering_phyml_dna(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '--no-ml-tree "%s"' % path_from_function())
    assert "Clustering methods are only available when using raxml" in caplog.text(
    )
コード例 #40
0
def test_incmat():
	'''This test should fail due to incorrect line length'''
	HERE = os.path.abspath(os.path.dirname(__file__))
	full_path = os.path.join(HERE, "incmat")
	with pytest.raises(util.PartitionFinderError):
		main.call_main("morphology", '--no-ml-tree --min-subset-size 1 --raxml "%s"' % full_path)
コード例 #41
0
def test_grand():
    full_path = os.path.join(HERE, "Grande_2013")
    main.call_main("DNA", '--raxml "%s"' % full_path)
コード例 #42
0
def test_greedy_phyml_dna():
    main.call_main("DNA", '"%s"' % path_from_function())
コード例 #43
0
def test_greedy_phyml_dna():
    main.call_main("DNA", '--no-ml-tree "%s"' % path_from_function())
コード例 #44
0
def test_greedy_raxml_dna():
    main.call_main("DNA", '"%s" --raxml' % path_from_function())
コード例 #45
0
def test_clustering_raxml_dna():
    main.call_main("DNA", '--no-ml-tree "%s" --raxml' % path_from_function())
コード例 #46
0
def test_greedy_phyml_protein():
    main.call_main("protein", '"%s"' % path_from_function())
コード例 #47
0
def test_overlap_error(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "sites overlap in your block definitions" in caplog.text()
コード例 #48
0
def test_greedy_raxml_protein():
    main.call_main("protein", '"%s" --raxml' % path_from_function())
コード例 #49
0
def test_morph_entropy():
    full_path = os.path.join(HERE, "morph_entropy")
    main.call_main("morphology", '--raxml --kmeans entropy --min-subset-size 1 "%s"' % full_path)
コード例 #50
0
def test_model_greedy_phyml03(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s"' % path_from_function())
    assert "'WAG+LG+F+I' is not a model/list that is implemented in PartitionFinder." in caplog.text()
コード例 #51
0
def test_DNA_entropy():
    full_path = os.path.join(HERE, "DNA_entropy")
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '--raxml --kmeans entropy --min-subset-size 10 "%s"' % full_path)
コード例 #52
0
def test_model_greedy_raxml03(caplog):
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '"%s" --raxml' % path_from_function())
    assert "'MTART+I+G+F, WAG+I+G' is/are not a valid model(s)" in caplog.text()
コード例 #53
0
ファイル: test_pf2.py プロジェクト: brettc/partitionfinder
def test_missing_sites_warning(caplog):
    main.call_main("protein", '--no-ml-tree "%s"' % path_from_function())
    assert "These columns are missing from the block definitions" in caplog.text()
コード例 #54
0
ファイル: test_kmeans.py プロジェクト: brettc/partitionfinder
def test_grand():
    full_path = os.path.join(HERE, "Grande_2013")
    with pytest.raises(util.PartitionFinderError):
        main.call_main("DNA", '--no-ml-tree --raxml "%s"' % full_path)
コード例 #55
0
ファイル: test_quick.py プロジェクト: brettc/partitionfinder
def test_quick_analysis(test_folder):
    full_path = os.path.join(HERE, test_folder)
    main.call_main("DNA", '--no-ml-tree "%s" --force-restart' % full_path)
コード例 #56
0
def test_quick_analysis(test_folder):
    full_path = os.path.join(HERE, test_folder)
    main.call_main("DNA", '"%s" --force-restart' % full_path)