Exemplo n.º 1
0
    def test_plot(self):
        phy = PhyBo(self.inputfile, output_dir=self.tmp.as_posix())
        phy.get_GLS()
        glm = list(phy.stats.keys())[0]
        phy.plot_GLS(glm)
        phy.plot_ACS(glm)

        for method in ['bc', 'td', 'mr']:
            phy.get_MLN(glm, method=method)

        phy.plot_MLN(glm)
        phy.plot_MLN_3d(glm)
        phy.analyze(runs=[('weighted', (2, 1))], output_gml=True,
                    output_plot=True)
        phy.get_IVSD()
        phy.get_ACS(phy.best_model)
        phy.get_MSN(phy.best_model)
        phy.get_MSN(phy.best_model, deep_nodes=True)
        phy.plot_MSN(phy.best_model, conf=phy.conf)
        phy.plot_two_concepts('I', '15:2', '16:2')
        edge1, edge2 = list(phy.graph[phy.best_model].edges())[0]
        phy.get_edge(phy.best_model, edge1, edge2)
        phy.get_edge(phy.best_model, 'Beijing', 'Shanghai')
        phy.get_edge(phy.best_model, edge1, edge2, msn=True)
        phy.get_PDC('w-2-1', aligned_output=True)
        phy.plot_concept_evolution(phy.best_model, concept="I")
Exemplo n.º 2
0
def test_plot(inputfile, mocker, Bmp, Sp, Plt, tmppath):
    mocker.patch('lingpy.compare.phylogeny.mpl', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.gls2gml', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.plot_tree', new=mocker.MagicMock())
    mocker.patch('lingpy.compare.phylogeny.bmp', new=Bmp)
    mocker.patch('lingpy.compare.phylogeny.plt', new=Plt)
    mocker.patch('lingpy.compare.phylogeny.sp', new=Sp)

    phy = PhyBo(inputfile, output_dir=str(tmppath))
    phy.get_GLS()
    glm = list(phy.stats.keys())[0]
    phy.plot_GLS(glm)
    phy.plot_ACS(glm)

    for method in ['bc', 'td', 'mr']:
        phy.get_MLN(glm, method=method)

    phy.plot_MLN(glm)
    phy.plot_MLN_3d(glm)
    phy.analyze(runs=[('weighted', (2, 1))], output_gml=True, output_plot=True)
    phy.get_IVSD()
    phy.get_ACS(phy.best_model)
    phy.get_MSN(phy.best_model)
    phy.get_MSN(phy.best_model, deep_nodes=True)
    phy.plot_MSN(phy.best_model, conf=phy.conf)
    phy.plot_two_concepts('I', '15:2', '16:2')
    edge1, edge2 = list(phy.graph[phy.best_model].edges())[0]
    phy.get_edge(phy.best_model, edge1, edge2)
    phy.get_edge(phy.best_model, 'Beijing', 'Shanghai')
    phy.get_edge(phy.best_model, edge1, edge2, msn=True)
    phy.get_PDC('w-2-1', aligned_output=True)
    phy.plot_concept_evolution(phy.best_model, concept="I")