又一个绘图库。这个库支持“groot”:t:,提供处理系统发生树/网络边界上某个地方的图形的功能。
mgraph的Python项目详细描述
一个简单的、面向对象的图形库。
并专门为系统发生树/图边界上的某个图形提供支持。
100%用Python编写。
对于树木:t:`ete`或:t:`dendropy`是很好的选择。
循环图)
*最小连通子图
*计算四元组(对于非循环图)
*计算最小四元组(对于循环图)
*四元组图比较
*列表拆分
*从拆分构造图
*一致和超树一致,(基本算法,通过groot)
*一致性、超树一致性和系统发育推断(外包给当前最先进的工具),通过groot。
*子图通过谓词
*io:
*newick
*csv
*html:vis.js,cytoscape.js,SVG
*SVG
*Ete
*ASCII art
*可用性:
*面向对象的
*有据可查的
*使用ide编写-
*方法包括完整的参数细节和PEP484注释
安装mgraph
``
usage
----
:t:`mgraph`遵循面向对象的方法,其中节点和边是可以(或不可以)附加任意数据的对象。
`mgraph`:t:library使用“structuredext<;http://docutils.sourceforge.net/rst.html>;``uu.
代码块:
from mgraph import mgraph
g=mgraph.from_newick(((A,B,C);“
node1=g.nodes.by_data(“A”)
node2=g.nodes.by_data(“C”)
node3=node1.A D D_child(“D”)
node3.add_edge_to(node2)
print(g.to_csv())
所有边和节点都支持任意Python数据。
代码块:
from mgraph import mgraph
spam=g.write_node(“spam”)
beans=g.write_node({“name”:“beans”})
eggs=g.write_node(42)
g.write_edge(spam,beans,data={“types”:(“is_parent”,“is_relation”),“weight”:42})
`mgraph`:t:强制“单向”并对表示错误的次数多于意图的情况进行一些基本约束。
**约束1.*节点和边都是单数的;两个节点只能共享一条边,一条边只能跨两个节点。
这并不意味着节点之间不能有多个关系类型-边的“data”属性可以同时容纳这两种类型。
这有助于避免常见错误,并意味着在遍历图时,所有必需的数据都包含在单个节点中edge对象和程序员不必查看其他任何地方。
…代码块:
from mgraph import mgraph
g=mgraph()
node_1=g.write_node()
node_2=g.write_node()
data=“is-relation”)error
…代码块:
from-mgraph-import-mgraph
g=mggraph()
node_1=g.write_node()
不要这样做
g.write_edge(node_1,node_1,data=“like_自己自己”错误
node_1.data=“喜欢自己”
``
`mgraph`:t:使用执行“uu test_uu.py”文件。
每个源文件的代码覆盖率至少应为70%。
Meta
----
``ini
ui=bitbucket,pypi,web
language=python3
author=martin rusilowicz
license=https://www.gnu.org/licenses/agpl-3.0.html
type=library
``
并专门为系统发生树/图边界上的某个图形提供支持。
100%用Python编写。
对于树木:t:`ete`或:t:`dendropy`是很好的选择。
循环图)
*最小连通子图
*计算四元组(对于非循环图)
*计算最小四元组(对于循环图)
*四元组图比较
*列表拆分
*从拆分构造图
*一致和超树一致,(基本算法,通过groot)
*一致性、超树一致性和系统发育推断(外包给当前最先进的工具),通过groot。
*子图通过谓词
*io:
*newick
*csv
*html:vis.js,cytoscape.js,SVG
*SVG
*Ete
*ASCII art
*可用性:
*面向对象的
*有据可查的
*使用ide编写-
*方法包括完整的参数细节和PEP484注释
安装mgraph
``
usage
----
:t:`mgraph`遵循面向对象的方法,其中节点和边是可以(或不可以)附加任意数据的对象。
`mgraph`:t:library使用“structuredext<;http://docutils.sourceforge.net/rst.html>;``uu.
代码块:
from mgraph import mgraph
g=mgraph.from_newick(((A,B,C);“
node1=g.nodes.by_data(“A”)
node2=g.nodes.by_data(“C”)
node3=node1.A D D_child(“D”)
node3.add_edge_to(node2)
print(g.to_csv())
所有边和节点都支持任意Python数据。
代码块:
from mgraph import mgraph
beans=g.write_node({“name”:“beans”})
eggs=g.write_node(42)
g.write_edge(spam,beans,data={“types”:(“is_parent”,“is_relation”),“weight”:42})
`mgraph`:t:强制“单向”并对表示错误的次数多于意图的情况进行一些基本约束。
**约束1.*节点和边都是单数的;两个节点只能共享一条边,一条边只能跨两个节点。
这并不意味着节点之间不能有多个关系类型-边的“data”属性可以同时容纳这两种类型。
这有助于避免常见错误,并意味着在遍历图时,所有必需的数据都包含在单个节点中edge对象和程序员不必查看其他任何地方。
…代码块:
from mgraph import mgraph
g=mgraph()
node_1=g.write_node()
node_2=g.write_node()
data=“is-relation”)error
…代码块:
from-mgraph-import-mgraph
g=mggraph()
node_1=g.write_node()
不要这样做
g.write_edge(node_1,node_1,data=“like_自己自己”错误
node_1.data=“喜欢自己”
``
`mgraph`:t:使用执行“uu test_uu.py”文件。
每个源文件的代码覆盖率至少应为70%。
Meta
----
``ini
ui=bitbucket,pypi,web
language=python3
author=martin rusilowicz
license=https://www.gnu.org/licenses/agpl-3.0.html
type=library
``