<commit_before>pytabix
=======

This module allows fast random access to sorted files compressed with bgzip_ and
indexed by tabix_. It includes a C extension with code from klib_. The bgzip
and tabix programs are available here_.

Alternatives: 

- Instead of using this module, you can install tabix_ yourself and
  easily call it from Python as shown at the bottom of this page.
  
- pysam_ - A python module for reading and manipulating Samfiles.
  It's a lightweight wrapper of the samtools C-API.
  Pysam also includes an interface for tabix_.

- hts-python_ - A pythonic wrapper for htslib_ C-API using python cffi_.

.. _pysam: https://github.com/pysam-developers/pysam
.. _hts-python: https://github.com/brentp/hts-python
.. _htslib: https://github.com/samtools/htslib
.. _cffi: https://cffi.readthedocs.org


Synopsis
--------

Open a local or remote file that has already been sorted, compressed, and indexed:

.. code:: python

    import tabix

    url = "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20100804/"
    url += "ALL.2of4intersection.20100804.genotypes.vcf.gz"

    tb = tabix.open(url)

    records = tb.query("1", 1000000, 1250000)
    records = tb.queryi(0, 1000000, 1250000)
    records = tb.querys("1:1000000-1250000")

    for record in records:
        print record[:3]

.. code:: python

    ['1', '1000760', 'rs75316104']
    ['1', '1000760', 'rs75316104']
    ['1', '1000894', 'rs114006445']
    ['1', '1000910', 'rs79750022']
    ['1', '1001177', 'rs4970401']
    ['1', '1001256', 'rs78650406']


Install
-------

.. code:: bash

    pip install --user pytabix

or

.. code:: bash

    wget https://pypi.python.org/packages/source/p/pytabix/pytabix-0.0.2.tar.gz
    tar xf pytabix-0.0.2.tar.gz
    cd pytabix-0.0.2
    python setup.py install --user

How to prepare a file for `tabix`<commit_msg>add Contributing section<commit_after>pytabix
=======

This module allows fast random access to sorted files compressed with bgzip_ and
indexed by tabix_. It includes a C extension with code from klib_. The bgzip
and tabix programs are available here_.

Alternatives: 

- Instead of using this module, you can install tabix_ yourself and
  easily call it from Python as shown at the bottom of this page.
  
- pysam_ - A python module for reading and manipulating Samfiles.
  It's a lightweight wrapper of the samtools C-API.
  Pysam also includes an interface for tabix_.

- hts-python_ - A pythonic wrapper for htslib_ C-API using python cffi_.

.. _pysam: https://github.com/pysam-developers/pysam
.. _hts-python: https://github.com/brentp/hts-python
.. _htslib: https://github.com/samtools/htslib
.. _cffi: https://cffi.readthedocs.org


Synopsis
--------

Open a local or remote file that has already been sorted, compressed, and indexed:

.. code:: python

    import tabix

    url = "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20100804/"
    url += "ALL.2of4intersection.20100804.genotypes.vcf.gz"

    tb = tabix.open(url)

    records = tb.query("1", 1000000, 1250000)
    records = tb.queryi(0, 1000000, 1250000)
    records = tb.querys("1:1000000-1250000")

    for record in records:
        print record[:3]

.. code:: python

    ['1', '1000760', 'rs75316104']
    ['1', '1000760', 'rs75316104']
    ['1', '1000894', 'rs114006445']
    ['1', '1000910', 'rs79750022']
    ['1', '1001177', 'rs4970401']
    ['1', '1001256', 'rs78650406']


Install
-------

.. code:: bash

    pip install --user pytabix

or

.. code:: bash

    wget https://pypi.python.org/packages/source/p/pytabix/pytabix-0.0.2.tar.gz
    tar xf pytabix-0.0.2.tar.gz
    cd pytabix-0.0.2
    python setup.py install --user

Contributing
------------

Please `submit an issue`__ to report bugs or ask questions.

__ https://github.com/slowkow/pytabix/issues

Please contribute bug fixes or new features with a `pull request`__ to this repository.

__ https://help.github.com/articles/using-pull-requests/

How to prepare a file for `tabix`
{'fraction_non_alphanumeric': 0.13257575757575757, 'fraction_numerical': 0.08787878787878788, 'mean_word_length': 3.130344108446298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '440063', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1372, 'n_words': 408}