Skip to main content

Clustering heatmap tool for kraken-style reports

Project description

coverage report pipeline status PyPI version DOI

groupBug

Clustering heatmap tool for kraken-style reports. Takes kraken style reports in text file format from eithr Kraken or Centrifuge (use centrifuge-kreport.pl). Produces a clustermap using seaborn of top species (default) using z scores for the heatmap and euclidean centroid clustering for the dendrograms.

This work was inspired by the excellent hclust script available for metaphlan analysis, see here https://bitbucket.org/biobakery/biobakery/wiki/metaphlan2#rst-header-create-a-heatmap-with-hclust2. And Pavian see here, https://github.com/fbreitwieser/pavian.

This work was funded by NIHR Biomedical Research Centre at Oxford University Hospitals NHS Foundation Trust and the University of Oxford.

Installation

From github

git clone https://gitlab.com/ModernisingMedicalMicrobiology/groupBug
cd groupBug
sudo python3 setup.py install

From pip3

sudo pip3 install groupBug

From pip3 if you don't have admin rights

pip3 install --user groupBug

Requirements

Written in python3 only and Currently dependant on the following packages:

pandas ete3 matplotlib seaborn six coverage nose

An X display server is needed if the -sv/--saveName parameter is not used.

Usage

Command line options are as follows.

usage: groupBug.py [-h] -k KRAKEN_REPORTS [KRAKEN_REPORTS ...] [-d DOMAIN]
                   [-t TAXIDS [TAXIDS ...]] [-sv SAVENAME] [-n TOPNUM]
                   [-suf SUF]

cluster heatmap and information from kraken reports

optional arguments:
  -h, --help            show this help message and exit
  -k KRAKEN_REPORTS [KRAKEN_REPORTS ...], --kraken_reports KRAKEN_REPORTS [KRAKEN_REPORTS ...]
                        list of kraken style report files
  -d DOMAIN, --domain DOMAIN
                        Domain of life to display, bacteria, viruses etc
  -t TAXIDS [TAXIDS ...], --taxids TAXIDS [TAXIDS ...]
                        list of taxids to specifically count
  -sv SAVENAME, --saveName SAVENAME
                        file name to save plot as
  -n TOPNUM, --topNum TOPNUM
                        Number of discrete species to display
  -suf SUF, --suf SUF   suffix to delete from sample name

For example, use this command to display the top bacterial species.

groupBug.py -k kreports/* 

This will prodcuce a chart like this.

The file names are used as sample labels along the x axis. To remove suffixes, use the -suf options like such.

groupBug.py -k reports/* -suf _kreport_score_150.txt

This will prodcuce a chart like this.

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

groupBug-0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

groupBug-0.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file groupBug-0.3.tar.gz.

File metadata

  • Download URL: groupBug-0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for groupBug-0.3.tar.gz
Algorithm Hash digest
SHA256 47d27e0d2d348773a27b5aba414289894779c158d2102b6c3e1690b9201c9b37
MD5 028eaf5b752274101b07a8272de10954
BLAKE2b-256 7e98a0f5f088b2de8d0d47d9a80a61da73ece0846030e825fb5c5af920aad5d5

See more details on using hashes here.

File details

Details for the file groupBug-0.3-py3-none-any.whl.

File metadata

  • Download URL: groupBug-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for groupBug-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b565d7d243d7ded5d15494fc07693a33f1176816c356bb36b288dfe0d0527d9f
MD5 d4a25470a023195b43343adf52a42fba
BLAKE2b-256 a24d629b9d8c379654a494f8e0cad9bdb198b480cbdb2d3c83fef1de7d47c954

See more details on using hashes here.

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