2 个版本

0.1.62 2022 年 11 月 12 日
0.1.6 2022 年 10 月 15 日

#308科学

MIT 许可证

110KB
2K SLoC

oxygraphis

简介

一个用于与二分生态图交互的小型 crate 和命令行工具。

CLI 详情

安装

目前您需要克隆此仓库并从源代码构建。无需担心,只需下载 Rust 工具链。然后

git clone https://github.com/Euphrasiologist/oxygraphis
cd oxygraphis
# install to path.
cargo install --path=.

界面

二分图是我们感兴趣的图。直接分析这些图或模拟它们。

Usage: oxygraphis [COMMAND]

Commands:
  bipartite  Generate and analyse bipartite graphs.
  simulate   Simulate a number of graphs, and return calculations over the samples.
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help information
  -V, --version  Print version information

二分图

bipartite 子命令。

Generate and analyse bipartite graphs.

Usage: oxygraphis bipartite [OPTIONS] <INPUT_DSV> [DELIMITER] [COMMAND]

Commands:
  interaction-matrix  Coerce a bipartite graph into an interaction matrix.
  derived-graphs      Coerce a bipartite graph into two derived graphs.
  modularity          Derive the modularity of a bipartite graph.
  help                Print this message or the help of the given subcommand(s)

Arguments:
  <INPUT_DSV>  An input DSV with three headers only: from, to, and weight.
  [DELIMITER]  Specify the delimiter of the DSV; we assume tabs.

Options:
  -p, --plotbp                 Render an SVG bipartite graph plot.
  -d, --degreedistribution     Return the degree distribution of a bipartite graph.
  -b, --bivariatedistribution  Return the bivariate degree distribution of a bipartite graph.
  -h, --help                   Print help information

输入必须是只有三列的定界文件

from    to    weight
Sp1    Sp2    1.0
Sp2    Sp3    1.0
Sp1    Sp3    1.0

并且应该具有二分结构(即边只从层 1 -> 层 2)。如果不满足此条件,则会发出警告,但不会使程序停止。

派生图

派生图是显示层中物种之间关系的图。

Coerce a bipartite graph into two derived graphs.

Usage: oxygraphis bipartite <INPUT_DSV> derived-graphs [OPTIONS]

Options:
  -p, --plotdg               Render an SVG derived graph of a stratum.
  -s, --stratum [<STRATUM>]  The stratum to display. [default: host] [possible values: host, parasite]
  -r, --remove [<REMOVE>]    Edges with fewer than this number of connections are removed from the graph. [default: 2.0]
  -h, --help                 Print help information

交互矩阵

这些构成了某些有趣二分分析的核心。基本上是一个 n x m 矩阵,其中包含网络中所有可能的物种-物种交互。

Coerce a bipartite graph into an interaction matrix.

Usage: oxygraphis bipartite <INPUT_DSV> interaction-matrix [OPTIONS]

Options:
      --print   Print the inner matrix as a TSV. Mainly for debugging.
  -p, --plotim  Render an SVG interaction matrix plot.
  -n, --nodf    Compute the NODF number of a *sorted* interaction matrix.
  -h, --help    Print help information

模块化

在二分图生成的交互矩阵上运行的算法。它试图在矩阵中找到物种-宿主交互的模块。

Derive the modularity of a bipartite graph.

Usage: oxygraphis bipartite <INPUT_DSV> modularity [OPTIONS]

Options:
  -l, --lpawbplus      Compute the modularity of a bipartite network using LPAwb+ algorithm.
  -d, --dirtlpawbplus  Compute the modularity of a bipartite network using DIRTLPAwb+ algorithm.
  -p, --plotmod        Plot the interaction matrix of a bipartite network, sorted to maximise modularity.
  -h, --help           Print help information

模拟

一个子命令用于模拟多个随机图(Erdös-Rényi)并对每个执行计算。

Simulate a number of graphs, and return calculations over the samples.

Usage: oxygraphis simulate [OPTIONS] --parasitenumber <PARASITENUMBER> --hostnumber <HOSTNUMBER> --edgecount <EDGECOUNT>

Options:
      --parasitenumber <PARASITENUMBER>
          Number of parasite nodes in the graph.
      --hostnumber <HOSTNUMBER>
          Number of host nodes in the graph.
  -e, --edgecount <EDGECOUNT>
          Number of edges in the graph.
  -n, --nsims [<NSIMS>]
          Number of random samples to make. [default: 1000]
  -c, --calculation [<CALCULATION>]
          The calculation to make. [default: nodf] [possible values: nodf, lpawbplus, dirtlpawbplus, degree-distribution, bivariate-distribution]
  -h, --help
          Print help information

Oxygraphis..?

Oxygraphis 是仅包含 5-6 个属的被子植物之一,其中 graph 完全包含在名称中。它属于毛茛科。

依赖关系

~9MB
~145K SLoC