Skip to main content

A python package for parsing, merging, and analyzing Kraken2 output files.

Project description

kraut

Run Pytest GitHub Release PyPI - Downloads Conda Downloads GitHub commit activity License: MIT

Kraut logo

A python package for parsing, merging, and analyzing Kraken2 output files.

Installation

From PyPI:

pip install krautils

From a local checkout:

pip install .

For developer's dependencies:

pip install .[dev]
pytest

Command

kraut parses, filters, merges, tabulates, splits, and plots Kraken2 reports.

  • single-report: filter or reformat one Kraken report.
  • make-table: build a configurable multi-sample abundance table.
  • make-mpa-table: merge MetaPhlAn profiles into a multi-sample abundance table.
  • table-summary: summarize a table produced by make-table.
  • ma-export: export reports for MicrobiomeAnalyst as counts, taxonomy, metadata, and tree files.
  • alpha: calculate alpha diversity from Kraken or Bracken reports.
  • beta: calculate beta diversity distance matrices and heatmap/PCA plots.
  • dendrogram: plot hierarchical clustering dendrograms from beta distances.
  • split-combine-table: split a KrakenTools combined table into ALL/LVL tables.
  • plot-single: plot one sample as an HTML or static composition chart.
  • plot-multi: plot multiple samples as an HTML or static stacked/bubble chart.
kraut alpha reports/*.tsv -o alpha.tsv -p alpha.html --metrics core --add-metrics chao1,ace
kraut beta reports/*.tsv -o beta.tsv --plot beta.html --pca beta_pca.html
kraut dendrogram reports/*.tsv -o dendrogram.html --distance braycurtis --clustering ward
kraut ma-export reports/*.tsv -o microbiomeanalyst --metadata metadata.tsv --metadata-sample-col Sample
kraut make-mpa-table profiles/*_profile.tsv -o metaphlan_species.tsv --keep-taxid --drop-unclassified --normalise

ma-export writes counts.csv, taxonomy.csv, metadata.csv, and tree.nwk. It uses taxon-specific counts by default (--metric LVL); use --metric TOT for cumulative clade counts.

Example plots:

Kraut Multi

Kraut Single

License

This project is licensed under the MIT License. See LICENSE.

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

krautils-0.7.0.tar.gz (57.0 kB view details)

Uploaded Source

Built Distribution

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

krautils-0.7.0-py3-none-any.whl (54.4 kB view details)

Uploaded Python 3

File details

Details for the file krautils-0.7.0.tar.gz.

File metadata

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

File hashes

Hashes for krautils-0.7.0.tar.gz
Algorithm Hash digest
SHA256 76e0744ebf608b39194def3081eda653e103d864b4e074363b39394d59e581ba
MD5 d5b7e077c48069ebb6cec91e0e2c88de
BLAKE2b-256 f4c04ffb3b0efdabc007b30c0015f32c7b95b3841d655d5735aac01aac5d6916

See more details on using hashes here.

Provenance

The following attestation bundles were made for krautils-0.7.0.tar.gz:

Publisher: publish.yml on quadram-institute-bioscience/kraut

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

File details

Details for the file krautils-0.7.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for krautils-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b65e53ce34b84a74fc23863460aaab23935d6c126a9d9f7fc459209e6be6859
MD5 3ed0402fce1cd5e03a33dfc8b78f92de
BLAKE2b-256 cd54a6ffff3b1dc43a376e64f68617f5cf52b78bd658d538cb9b8fb15d24919a

See more details on using hashes here.

Provenance

The following attestation bundles were made for krautils-0.7.0-py3-none-any.whl:

Publisher: publish.yml on quadram-institute-bioscience/kraut

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