============================================================================
Pure-python implementation of UCSC ``liftOver`` genome coordinate conversion
============================================================================
.. image:: https://travis-ci.org/konstantint/pyliftover.png?branch=master :target: https://travis-ci.org/konstantint/pyliftover
PyLiftover is a library for quick and easy conversion of genomic (point) coordinates between different assemblies.
It uses the same logic and coordinate conversion mappings as the UCSC `liftOver tool <http://genome.ucsc.edu/cgi-bin/hgLiftOver>`_.
As of current version (0.2), PyLiftover only does conversion of point coordinates, that is,
unlike ``liftOver``, it does not convert ranges, nor does it provide any special facilities to work with BED files.
For single-point coordinates it produces exactly the same output as ``liftOver`` (verified with at least the ``hg17ToHg18.over.chain.gz`` file for now).
Installation
------------
The simplest way to install the package is via ``easy_install`` or ``pip``::
$ easy_install pyliftover
Usage
-----
The primary usage example, supported by the library is the following::
from pyliftover import LiftOver
lo = LiftOver('hg17', 'hg18')
lo.convert_coordinate('chr1', 1000000)
The first line will automatically download the hg17-to-hg18 coordinate conversion `chain file <http://genome.ucsc.edu/goldenPath/help/chain.html>`_ from UCSC,
unless it is already cached or available in the current directory. Alternatively, you may provide your own chain file::
lo = LiftOver('hg17ToHg18.over.chain.gz')
lo.convert_coordinate('chr1', 1000000, '-')
The result of ``lo.convert_coordinate`` call is either ``None`` (if the source chromosome name is unrecognized) or a list of target positions in the
new assembly. The list may be empty (locus is deleted in the new assembly), have a single element (locus matched uniquely), or, in principle,
have multiple elements (although this is probably a rare occasion for most default intra-species genomic conversions).
Note that coordinates in the tool are 0-based. That is, a position that you would refer to in the genome browser by ``chr1:10``
corresponds to coordinate ``9`` in PyLiftover's terms.
Although you may try to apply the tool with arbitrary chain files, like the original ``liftOver`` tool, it makes most sense for conversion of
coordinates between different assemblies of the same species.
See also
--------
* Blog post: http://fouryears.eu/2013/02/25/the-curse-of-genomic-coordinates/
* Report issues and submit fixes at Github: https://github.com/konstantint/pyliftover
Raw data
{
"_id": null,
"home_page": "https://github.com/konstantint/pyliftover",
"name": "pyliftover",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "bioinformatics liftover genome-analysis",
"author": "Konstantin Tretyakov",
"author_email": "kt@ut.ee",
"download_url": "https://files.pythonhosted.org/packages/00/e8/f09804e990d66d235f4c90cb343bdc540ec17b67c925e72c67432a4d6130/pyliftover-0.4.1.tar.gz",
"platform": "Platform Independent",
"description": "============================================================================\nPure-python implementation of UCSC ``liftOver`` genome coordinate conversion\n============================================================================\n\n.. image:: https://travis-ci.org/konstantint/pyliftover.png?branch=master :target: https://travis-ci.org/konstantint/pyliftover\n\nPyLiftover is a library for quick and easy conversion of genomic (point) coordinates between different assemblies.\n\nIt uses the same logic and coordinate conversion mappings as the UCSC `liftOver tool <http://genome.ucsc.edu/cgi-bin/hgLiftOver>`_.\n\nAs of current version (0.2), PyLiftover only does conversion of point coordinates, that is, \nunlike ``liftOver``, it does not convert ranges, nor does it provide any special facilities to work with BED files.\nFor single-point coordinates it produces exactly the same output as ``liftOver`` (verified with at least the ``hg17ToHg18.over.chain.gz`` file for now).\n\nInstallation\n------------\n\nThe simplest way to install the package is via ``easy_install`` or ``pip``::\n\n $ easy_install pyliftover\n\nUsage\n-----\nThe primary usage example, supported by the library is the following::\n\n from pyliftover import LiftOver\n lo = LiftOver('hg17', 'hg18')\n lo.convert_coordinate('chr1', 1000000)\n\nThe first line will automatically download the hg17-to-hg18 coordinate conversion `chain file <http://genome.ucsc.edu/goldenPath/help/chain.html>`_ from UCSC,\nunless it is already cached or available in the current directory. Alternatively, you may provide your own chain file::\n\n lo = LiftOver('hg17ToHg18.over.chain.gz')\n lo.convert_coordinate('chr1', 1000000, '-')\n\nThe result of ``lo.convert_coordinate`` call is either ``None`` (if the source chromosome name is unrecognized) or a list of target positions in the\nnew assembly. The list may be empty (locus is deleted in the new assembly), have a single element (locus matched uniquely), or, in principle, \nhave multiple elements (although this is probably a rare occasion for most default intra-species genomic conversions).\nNote that coordinates in the tool are 0-based. That is, a position that you would refer to in the genome browser by ``chr1:10`` \ncorresponds to coordinate ``9`` in PyLiftover's terms.\n\nAlthough you may try to apply the tool with arbitrary chain files, like the original ``liftOver`` tool, it makes most sense for conversion of \ncoordinates between different assemblies of the same species.\n\n\nSee also\n--------\n\n* Blog post: http://fouryears.eu/2013/02/25/the-curse-of-genomic-coordinates/\n* Report issues and submit fixes at Github: https://github.com/konstantint/pyliftover\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pure-python implementation of UCSC ``liftOver`` genome coordinate conversion.",
"version": "0.4.1",
"project_urls": {
"Homepage": "https://github.com/konstantint/pyliftover"
},
"split_keywords": [
"bioinformatics",
"liftover",
"genome-analysis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b161e3afcf369fe45223cfebfbb8cde46d521e2786889c1b3eed01ee08adb626",
"md5": "50b4e8a80b7d33c9280ee806941bde8c",
"sha256": "49ef8938010d2e934abb483d3ef8073897ed6b88bcd978c486c8f7631c24dbc1"
},
"downloads": -1,
"filename": "pyliftover-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "50b4e8a80b7d33c9280ee806941bde8c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12394,
"upload_time": "2024-02-08T21:32:15",
"upload_time_iso_8601": "2024-02-08T21:32:15.157447Z",
"url": "https://files.pythonhosted.org/packages/b1/61/e3afcf369fe45223cfebfbb8cde46d521e2786889c1b3eed01ee08adb626/pyliftover-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "00e8f09804e990d66d235f4c90cb343bdc540ec17b67c925e72c67432a4d6130",
"md5": "fa5336560439e158b237150cafce8a61",
"sha256": "33ad187e35d1b6662ba446432f4dd1a808ac2914ce1645eef37598fa5a3860cd"
},
"downloads": -1,
"filename": "pyliftover-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "fa5336560439e158b237150cafce8a61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11911,
"upload_time": "2024-02-08T21:32:16",
"upload_time_iso_8601": "2024-02-08T21:32:16.566324Z",
"url": "https://files.pythonhosted.org/packages/00/e8/f09804e990d66d235f4c90cb343bdc540ec17b67c925e72c67432a4d6130/pyliftover-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-08 21:32:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "konstantint",
"github_project": "pyliftover",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "pyliftover"
}