Skip to main content

Sankey diagram for Microbial Enrichment cultures.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sankeymien-0.0.3.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sankeymien-0.0.3-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file sankeymien-0.0.3.tar.gz.

File metadata

  • Download URL: sankeymien-0.0.3.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sankeymien-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3c87d185cc396eae6102f551005cc2f811e09517b45cfd34977f407059807490
MD5 0bacd3cb2f8292f0fb7bf9a31989a1a6
BLAKE2b-256 921367a99576cb95c56370c64dab5cfe723b35a55b8b3af232b9a3d5639a3651

See more details on using hashes here.

Provenance

The following attestation bundles were made for sankeymien-0.0.3.tar.gz:

Publisher: python-publish.yml on ArnaudBelcour/sankeymien

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sankeymien-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sankeymien-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sankeymien-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d76a9343196d9960c31c42f632728e1143a2ae26cbc24f80572a4af2cf0a68fc
MD5 ff7102629a5303dbe35c2e9fb5a51f95
BLAKE2b-256 2ce5b45da2f9ec8234630e6e64faff02259104494b463aeacd34809aab634b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sankeymien-0.0.3-py3-none-any.whl:

Publisher: python-publish.yml on ArnaudBelcour/sankeymien

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page