Skip to main content

DNA input and output library for Python and Cython. Includes reader and writer for FASTA and FASTQ files, support for samtools faidx files, and generators for solid and gapped q-grams (k-mers).

Project description

Dinopy - DNA input and output for Python and Cython

https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat https://img.shields.io/pypi/v/dinopy.svg?style=flat

Dinopy’s goal is to make files containing biological sequences easily and efficiently accessible for Python and Cython programmers, allowing them to focus on their application instead of file-io.

#!python

import dinopy
fq_reader = dinopy.FastqReader("reads.fastq")
for sequence, name, quality in fq_reader.reads(quality_values=True):
    if some_function(quality):
        analyze(seq)

Features

  • Easy to use reader and writer for FASTA-, FASTQ-, and SAM-files.

  • Specifiable data type and representation for return values (bytes, bytearrays, strings and integers see dtype for more information).

  • Implemented in Cython for additional speedup.

  • Offers a Cython API to avoid introducing Python code into Cython projects.

  • Works directly on gzipped files.

  • Iterators for q-grams of a sequence (also allowing shaped q-grams).

  • (Reverse) complement.

  • Chromosome selection from FASTA files.

Getting Started

  • If you are new to dinopy you can get started by following the first-steps tutorial.

  • A full list of features, as well as the documentation, can be found here.

Installation

Dinopy can be installed with pip:

$ pip install dinopy

or with conda:

$ conda install -c bioconda dinopy

Additionally, dinopy can be downloaded from Bitbucket and compiled using its setup.py:

  1. Download source code from bitbucket.

  2. Install globally:

    $ python setup.py install

    or only for the current user:

    $ python setup.py install --user
  3. Use dinopy:

    $ python
    
    >>> import dinopy

Installation requirements

  • python >= 3.3

  • numpy >= 1.7

  • C and C++ compilers, for example from build-essentials (Linux) or Xcode (OSX)

  • Optional: cython >= 0.20

We recommend using anaconda and the bioconda channel.

$ conda config --add channels bioconda
$ conda create -n dinoenv dinopy

Platform support

Dinopy has been tested on Ubuntu, Arch Linux and OS X (Yosemite and El Capitan).

We do not officially support Windows - dinopy will probably work, but there might be problems due to different linebreak styles; we assume \n as separator but the probability to encounter files with \r\n as line-separator might be higher on Windows.

Contact

If you want to report a bug or want to suggest a new feature, feel free to do so over at bitbucket.

Email:
  • Henning Timm: name.surname <at> tu-dortmund.de

  • Till Hartmann: name.surname <at> tu-dortmund.de

License

Dinopy is Open Source and licensed under the MIT 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

dinopy-2.0.2.tar.gz (1.6 MB view details)

Uploaded Source

File details

Details for the file dinopy-2.0.2.tar.gz.

File metadata

  • Download URL: dinopy-2.0.2.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for dinopy-2.0.2.tar.gz
Algorithm Hash digest
SHA256 18432e83f0c8c6a35ad7b4dab68aaa05b8139bf8358cc175ff4d5011760587e5
MD5 ff87547ab98e1111a7581c09ef667de2
BLAKE2b-256 098a7a2945c6e6b780bc259724d184076d2cdde35f8175a18e32af940b2d5887

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