Skip to main content

Sankey diagram for microbial enrichment culture

Python package to make Sankey diagram for Microbial Enrichment cultures.

Installation

This package requires:

  • plotly and kaleido (with google chrome installed) to generate Sankey diagrams.
  • pandas and numpy to handle dataframe and filter organisms according to abundance in samples.

Kaleido requires Google Chrome to be isntalled, which can be achieved with:

kaleido_get_chrome

Sankeymien and the python package dependencies can be installed with pip:

pip install sankeymien

It can be also installed by cloning this repository and with pip:

git clone https://github.com/ArnaudBelcour/sankeymien.git

cd sankeymien

pip install -e .

Usage

The package can be launched using the command line:

sankeymien -a abundance_table.tsv -j experiments.json -o testoutput -t taxon

-a abundance_table.tsv is a tabulated file containing as a first column organism ID, several columns corresponding to samples anda column containing taxon name (and given with -t taxon).

-j experiments.json is a json file indicating the experiments and the association between time steps and samples.

-o testoutput is the output folder.

--relative to use relative abundance instead of the abundance from the input files. This takes the abundance of an organism in a sample and it divides it by the total abundance in the sample.

--abundance-threshold abundance threshold used to show the edges and the associated taxa in the enrichment cultures.

Input

The abundance sample should look like this:

organism s1 s2 k1 Ec1_1 Ec1_2 Ec1_3 kec1 taxon
org_a 1 2 5 0 0 0 0 Bos
org_b 2000 3000 10 100 120 130 1 Escherichia
org_c 500 600 5 100 200 300 0 Parcubacteria
org_d 20 30 0 25 35 40 0 Methanobacterium

The json should correspond to this:

{
    "experiment_1": {
        "initial": ["s1", "s2"],
        "kit_control": ["k1"],
        "enrichment_T01": ["Ec1_1", "Ec1_2", "Ec1_3"],
        "kit_control_T01": ["kec1"]
    }
}

Output

It generates one output folder for each experiment in the json file. The output folder contains:

output_folder
├── experiment_1
│   ├── intermediary_folder
│   |   └── ...
│   |   └── edge_initial_to_enrichment_T01.tsv
│   |   └── sample_1_nitrogen_cycle.png
│   |   └── ...
│   ├── sankey_diagram_edge.tsv
│   ├── sankey_diagram_node.tsv
│   ├── sankey_diagram.png
├── sankeymien.log
├── sankeymien_metadata.json

intermediary_folder contains multiple tabulated file corresponding to sub part of the initial dataframe filtered to show only organisms ocurring in the associated edges of the Sankey diagram.

sankey_diagram.png a Sankey diagram showing the flow of relative abundance of organisms according to the different time steps of the enrichment cultures. The final enrichment is linked to taxon name to show the composition of the final communities.

sankey_diagram_edge.tsv indicates the different edges of the Sankey diagram.

sankey_diagram_node.tsv indicates the different nodes of the Sankey diagram.

sankeymien.log is a log file showing printed lines.

sankeymien_metadata.json contains metadata linked to the run: version of the different packages used.

Metadata

Release files for sankeymien 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sankeymien 0.0.3
File Size Uploaded
sankeymien-0.0.3.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sankeymien 0.0.3
File Interpreter ABI Platform
sankeymien-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / sankeymien-0.0.3.tar.gz

Download URL sankeymien-0.0.3.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3c87d185cc396eae6102f551005cc2f811e09517b45cfd34977f407059807490
BLAKE2b-256 checksum
How to use checksums
921367a99576cb95c56370c64dab5cfe723b35a55b8b3af232b9a3d5639a3651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / sankeymien-0.0.3-py3-none-any.whl

Download URL sankeymien-0.0.3-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d76a9343196d9960c31c42f632728e1143a2ae26cbc24f80572a4af2cf0a68fc
BLAKE2b-256 checksum
How to use checksums
2ce5b45da2f9ec8234630e6e64faff02259104494b463aeacd34809aab634b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page