The Python GTF toolkit (pygtftk) package: easy handling of GTF files
Project description
The Python GTF toolkit (pygtftk) package is intented to ease handling of GTF (Gene Transfer Format) files. The pygtftk package is compatible with Python 2.7 and Python >=3.5 and relies on libgtftk, a library of functions written in C.
The package comes with a set of UNIX commands that can be accessed through the gtftk program. The gtftk program proposes several atomic tools to filter, convert, or extract data from GTF files. The gtftk set of Unix commands can be easily extended using a basic plugin architecture. All these aspects are covered in the help sections.
While the gtftk Unix program comes with hundreds of unitary and functional tests, it is still upon active development and may thus suffer from bugs that remain to be discovered. Feel free to post any problem or required enhancement in the issue section of the github repository.
System requirements
Depending on the size of the GTF file, pygtftk and gtftk may require lot of memory to perform selected tasks. A computer with 16Go is recommended in order to be able to pipe several commands when working with human annotations from ensembl release (e.g. 91).
At the moment, the gtftk program has been tested on:
Linux (Ubuntu 12.04 and 18.04)
OSX (Yosemite, El Capitan).
Installation through conda package building
Installation through conda should be the prefered install solution. The pygtftk package and gtftk command line tool require external dependencies with some version constrains (e.g. bedtools that, we observed, displays some back compatibility issues).
A conda package will be available in the near future. In the meantime, you can however create an environment with all prerequisites using the commands below. If conda is not available on your system, first install miniconda from the official web site.
git clone git@github.com:dputhier/pygtftk.git pygtftk
cd pygtftk
conda env create -n pygtftk_py3k -f conda/env.yaml python=3.6
source activate pygtftk_py3k
make install
# It is important to call gtftk -h
# to find and dump plugin parsers
# before going further
gtftk -h
Installation through setup.py
This is not the prefered way for installation. Choose conda whenever possible. The gtftk Unix command line program has been tested with bedtools 2.27.1 (be aware that we have encountered some back compatibility issues with bedtools).
git clone git@github.com:dputhier/pygtftk.git pygtftk
cd pygtftk
# Check your Python version before (2.7 or >=3.5)
pip install -r requirements.txt
python setup.py install
Installation through pip (not functional at the moment)
Prerequesites
Again, this is not the prefered way for installation. Please choose conda whenever possible. The gtftk Unix command line program has been tested with bedtools 2.27.1 (be aware that we have encountered some back compatibility issues with bedtools).
Running pip
Installation through pip can be done as follow.
pip install -r requirements.txt
pip install pygtftk
# It is important to call gtftk -h
# to find and dump plugin parsers
# before going further
gtftk -h
Running functional tests
A lot of functional tests have been developed to ensure consistency with expected results. This does not rule out that bugs may hide throughout the code… In order to check that installation is functional you may be interested in running functional tests. The definition of all functional tests declared in gtftk commands is accessible using the -p/–plugin-tests argument:
gtftk -p
To run the tests, you will need to install bats (Bash Automated Testing System). Once bats is installed run the following commands:
# The tests should be run in the pygtftk git
# directory because several tests contains references (relative path)
# to file enclosed in pygtftk/data directory.
gtftk -p > gtftk_test.bats
bats gtftk_test.bats
Note, alternatively you may directly call the tests using the Makefile
make clean
make test
Or run tests in parallel using:
make clean
make test_para -j 10 # Using 10 cores
Running unitary tests
Several unitary tests have been implemented using doctests. You can run them using nose through the following command line:
make nose
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pygtftk-0.9.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cf3852dddfe272d198d55f380b8bbccfa2b94cd4e07399e9cac7ee1b0355d70 |
|
MD5 | 45bd3e169f8da5f9bfc16b9404ae2a44 |
|
BLAKE2b-256 | 119f48b0413fbaedd68e0fabc5897782065b1bf6c353884f4e0237c372af0ac5 |
Hashes for pygtftk-0.9.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbecbb6d8c009e95bb6526c8578df2089ba0020ff52c675192cd718460f69f03 |
|
MD5 | 4fa12b92ae24eef90da7605a9a3ad98b |
|
BLAKE2b-256 | c097a9793d17968d64177e6f59f22abe42fba19319737df80d8a79f08c91f814 |
Hashes for pygtftk-0.9.6-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bd20b8c919ec5c61a2d5c75f115eb555882590026f335d1f12f374d973b674f |
|
MD5 | e4dfc12a5d3f48cf150499f3ae4fa302 |
|
BLAKE2b-256 | 096ae35602c938e41745bae08a16dec38d64f17c7980963dfd0cc7de4308d99f |
Hashes for pygtftk-0.9.6-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c4f4d38ceecd3a59ecb94a91d2c98e8c6797e8d1cfaa8b17194dafeec2a699 |
|
MD5 | dc4d8a6769321c5e64a9836bedd7e138 |
|
BLAKE2b-256 | b0ab25432602fedf3cd6e6cb78a1cfb87482ff171595b7d181329f798064a10e |