Skip to main content

Utilities and datasets for deep learning in genomics

Project description

Janggu logo

Janggu is a python package that facilitates deep learning in the context of genomics. The package is freely available under a GPL-3.0 license.

Janggu visual abstract

In particular, the package allows for easy access to typical Genomics data formats and out-of-the-box evaluation so that you can concentrate on designing the neural network architecture for the purpose of quickly testing biological hypothesis. A comprehensive documentation is available here.

Hallmarks of Janggu:

  1. Janggu provides special Genomics datasets that allow you to access raw data in FASTA, BAM, BIGWIG, BED and GFF file format.

  2. Various normalization procedures are supported for dealing with of the genomics dataset, including ‘TPM’, ‘zscore’ or custom normalizers.

  3. The dataset are directly consumable with neural networks implemented in keras.

  4. Numpy format output of a keras model can be converted to represent genomic coverage tracks, which allows exporting the predictions as BIGWIG files and visualization of genome browser-like plots.

  5. Genomic datasets can be stored in various ways, including as numpy array, sparse dataset or in hdf5 format.

  6. Caching of Genomic datasets avoids time consuming preprocessing steps and facilitates fast reloading.

  7. Janggu provides a wrapper for keras models with built-in logging functionality and automatized result evaluation.

  8. Janggu provides a special keras layer for scanning both DNA strands for motif occurrences.

  9. Janggu provides keras models constructors that automatically infer input and output layer shapes to reduce code redundancy.

  10. Janggu provides a web application that allows to browse through the results.

Why the name Janggu?

Janggu is a Korean percussion instrument that looks like an hourglass.

Like the two ends of the instrument, the philosophy of the Janggu package is to help with the two ends of a deep learning application in genomics, namely data acquisition and evaluation.

Installation

The simplest way to install janggu is via the conda package management system. Assuming you have already installed conda, create a new environment and type

pip install janggu

The janggu neural network model depends on tensorflow which you have to install depending on whether you want to use GPU support or CPU only. To install tensorflow type

conda install tensorflow  # or tensorflow-gpu

Further information regarding the installation of tensorflow can be found on the official tensorflow webpage

To verify that the installation works try to run the example contained in the janggu package as follows

git clone https://github.com/BIMSBbioinfo/janggu
cd janggu
python ./src/examples/classify_fasta.py single

Changelog

0.9.0 (2019-03-20)

Added various features and bug fixes:

Changes in janggu.data - Added new dataset wrapper to remove NaNs: NanToNumConverter - Added new dataset wrappers for data augmentation: RandomOrientation, RandomSignalScale - Adapted ReduceDim wrapper: added aggregator argument - plotGenomeTrack added figsize option - plotGenomeTrack added other plot types, including heatmap and seqplot. - plotGenomeTrack refactoring of internal code - Bioseq bugfix: Fixed issue for reverse complementing N’s in the sequence. - GenomicArray: condition, order, resolution are not read from the cache anymore, but from the arguments to avoid inconsistencies - Normalization of Cover can handle a list of normalizer callables which are applied in turn - Normaliation and Transformation: Added PercentileTrimming, RegionLengthNormalization, LogTransform - ZScore and ZScoreLog do not apply RegionLengthNormalization by default anymore. - janggu.data version-aware caching of datasets included - Added copy method for janggu datasets. - split_train_test refactored - removed obsolete transformations attribute from the datasets - Adapted the documentation - Refactoring according to suggestions from isort and pylint

Changes in janggu - Added input_attribution via integrated gradients for feature importance assignment - Performance scoring by name for Janggu.evaluate for a number common metrices, including ROC, PRC, correlation, variance explained, etc. - training.log is stored by default for each model - Added model_from_json, model_from_yaml wrappers - inputlayer decorator only instantiates Input layers if inputs == None, which makes the use of inputlayer less restrictive when using nested functions - Added create_model method to create a keras model directly - Adapted the documentation - Refactoring according to suggestions from isort and pylint

0.8.6 (2019-03-03)

  • Bugfix for ROIs that reach beyond the chromosome when loading Bioseq datasets. Now, zero-padding is performed for intervals that stretch over the sequence ends.

0.8.5 (2019-01-09)

  • Updated abstract, added logo

  • Utility: janggutrim command line tool for cutting bed file regions to avoid unwanted rounding effects. If rounding issues are detected an error is raised.

  • Caching mechanism revisited. Caching of datasets is based on determining the sha256 hash of the dataset. If the data or some parameters change, the files are automatically reloaded. Consequently, the arguments overwrite and datatags become obsolete and have been marked for deprecation.

  • Refactored access of GenomicArray

  • Added ReduceDim wrapper to convert a 4D Cover object to a 2D table-like object.

0.8.4 (2018-12-11)

  • Updated installation instructions in the readme

0.8.3 (2018-12-05)

  • Fixed issues for loading SparseGenomicArray

  • Made GenomicIndexer.filter_by_region aware of flank

  • Fixed BedLoader of partially overlapping ROI and bedfiles issue using filter_by_region.

  • Adapted classifier, license and keywords in setup.py

  • Fixed hyperlinks

0.8.2 (2018-12-04)

  • Bugfix for zero-padding functionality

  • Added ndim for keras compatibility

0.8.1 (2018-12-03)

  • Bugfix in GenomicIndexer.create_from_region

0.8.0 (2018-12-02)

  • Improved test coverage

  • Improved linter issues

  • Bugs fixed

  • Improved documentation for scorers

  • Removed kwargs for scorers and exporters

  • Adapted exporters to classes

0.7.0 (2018-12-01)

  • First public version

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

janggu-0.9.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

janggu-0.9.0-py2.py3-none-any.whl (1.3 MB view details)

Uploaded Python 2Python 3

File details

Details for the file janggu-0.9.0.tar.gz.

File metadata

  • Download URL: janggu-0.9.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

File hashes

Hashes for janggu-0.9.0.tar.gz
Algorithm Hash digest
SHA256 cf41a09edccf929b5d3220bf052d293e8d7a14038e5098924c3be35c2adbaf66
MD5 eb04578da6e3232eda4bbcc52b2ceefa
BLAKE2b-256 6b99b9017629ea45e4a3ba4f225eb6def04cc2263a4d1dd93aeeeac2967157b0

See more details on using hashes here.

File details

Details for the file janggu-0.9.0-py2.py3-none-any.whl.

File metadata

  • Download URL: janggu-0.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

File hashes

Hashes for janggu-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ff72f919053a1f44e6ec1633394369541bd2f562074fffd913cad9f0b4a2da46
MD5 559ea8f881b0b8ab8ae4eda280b40d1f
BLAKE2b-256 84027b6a5bc0311e0f08b14e726425969fde8729ec5f6d24be79f4eec92facf3

See more details on using hashes here.

Supported by

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