{ "info": { "author": "Martin Sosic", "author_email": "sosic.martin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "=====\nEdlib\n=====\n\nLightweight, super fast library for sequence alignment using edit (Levenshtein) distance.\n\n.. code:: python\n\n edlib.align(\"hello\", \"world\")\n\nEdlib is actually a C/C++ library, and this package is it's wrapper for Python.\nPython Edlib has mostly the same API as C/C++ Edlib, so make sure to check out `C/C++ Edlib docs `_ for more code examples, details on API and how Edlib works.\n\n--------\nFeatures\n--------\n\n* Calculates **edit distance**.\n* It can find **optimal alignment path** (instructions how to transform first sequence into the second sequence).\n* It can find just the **start and/or end locations of alignment path** - can be useful when speed is more important than having exact alignment path.\n* Supports **multiple alignment methods**: global(**NW**), prefix(**SHW**) and infix(**HW**), each of them useful for different scenarios.\n* You can **extend character equality definition**, enabling you to e.g. have wildcard characters, to have case insensitive alignment or to work with degenerate nucleotides.\n* It can easily handle small or **very large** sequences, even when finding alignment path.\n* **Super fast** thanks to Myers's bit-vector algorithm.\n\nNOTE: Size of alphabet has to be <= 256 (meaning that query and target together must have <= 256 unique values).\n\n------------\nInstallation\n------------\n::\n\n pip install edlib\n\n---\nAPI\n---\n\nEdlib has two functions, `align()` and `getNiceAlignment()`:\n\n.. code:: python\n\n align(query, target, [mode], [task], [k])\n\n.. code:: python\n\n getNiceAlignment(alignResutl, query, target)\n\n\n\nTo learn more about it, type :code:`help(edlib.align)` in your python interpreter.\n\n-----\nUsage\n-----\n.. code:: python\n\n import edlib\n\n result = edlib.align(\"elephant\", \"telephone\")\n print(result[\"editDistance\"]) # 3\n print(result[\"alphabetLength\"]) # 8\n print(result[\"locations\"]) # [(None, 8)]\n print(result[\"cigar\"]) # None\n\n result = edlib.align(\"ACTG\", \"CACTRT\", mode=\"HW\", task=\"path\", additionalEqualities=[(\"R\", \"A\"), (\"R\", \"G\")])\n print(result[\"editDistance\"]) # 0\n print(result[\"alphabetLength\"]) # 5\n print(result[\"locations\"]) # [(1, 4)]\n print(result[\"cigar\"]) # \"4=\"\n\n result = edlib.align(\"elephant\", \"telephone\", task=\"path\") ## users must use 'task=\"path\"' \n niceAlign = edlib.getNiceAlignment(result, \"elephant\", \"telephone\")\n print(niceAlign['query_aligned']) # \"-elephant\"\n print(niceAlign['matched_aligned']) # \"-|||||.|.\"\n print(niceAlign['target_aligned']) # \"telephone\"\n\n\n\n\n---------\nBenchmark\n---------\n\nI run a simple benchmark on 7 Feb 2017 (using timeit, on Python3) to get a feeling of how Edlib compares to other Python libraries: `editdistance `_ and `python-Levenshtein `_.\n\nAs input data I used pairs of DNA sequences of different lengths, where each pair has about 90% similarity.\n\n::\n\n #1: query length: 30, target length: 30\n edlib.align(query, target): 1.88\u00b5s\n editdistance.eval(query, target): 1.26\u00b5s\n Levenshtein.distance(query, target): 0.43\u00b5s\n\n #2: query length: 100, target length: 100\n edlib.align(query, target): 3.64\u00b5s\n editdistance.eval(query, target): 3.86\u00b5s\n Levenshtein.distance(query, target): 14.1\u00b5s\n\n #3: query length: 1000, target length: 1000\n edlib.align(query, target): 0.047ms\n editdistance.eval(query, target): 5.4ms\n Levenshtein.distance(query, target): 1.9ms\n\n #4: query length: 10000, target length: 10000\n edlib.align(query, target): 0.0021s\n editdistance.eval(query, target): 0.56s\n Levenshtein.distance(query, target): 0.2s\n\n #5: query length: 50000, target length: 50000\n edlib.align(query, target): 0.031s\n editdistance.eval(query, target): 13.8s\n Levenshtein.distance(query, target): 5.0s\n\n----\nMore\n----\n\nCheck out `C/C++ Edlib docs `_ for more information about Edlib!\n\n-----------\nDevelopment\n-----------\n\nRun :code:`make build` to generate an extension module as .so file. You can test it then by importing it from python interpreter :code:`import edlib` and running :code:`edlib.align(...)` (you have to be positioned in the directory where .so was built). This is useful for testing while developing.\n\nRun :code:`make sdist` to create a source distribution, but not publish it - it is a tarball in dist/ that will be uploaded to pip on `publish`. Use this to check that tarball is well structured and contains all needed files, before you publish.\nGood way to test it is to run :code:`sudo pip install dist/edlib-*.tar.gz`, which will try to install edlib from it, same way as pip will do it when it is published.\n\nRun :code:`make publish` to create a source distribution and publish it to the PyPI. Use this to publish new version of package.\nMake sure to bump the version in `setup.py` before publishing, if needed.\n\n:code:`make clean` removes all generated files.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Martinsos/edlib", "keywords": "edit distance levenshtein align sequence bioinformatics", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "edlib", "package_url": "https://pypi.org/project/edlib/", "platform": "", "project_url": "https://pypi.org/project/edlib/", "project_urls": { "Homepage": "https://github.com/Martinsos/edlib" }, "release_url": "https://pypi.org/project/edlib/1.3.4/", "requires_dist": null, "requires_python": "", "summary": "Lightweight, super fast library for sequence alignment using edit (Levenshtein) distance.", "version": "1.3.4" }, "last_serial": 5711498, "releases": { "1.1.2": [ { "comment_text": "", "digests": { "md5": "979f1a528af0fc12e3ec527414ac3ae3", "sha256": "17068d8f8fe113a5a627a9431fa4329f6eaae5a08353f02afef0a902111a7653" }, "downloads": -1, "filename": "edlib-1.1.2.tar.gz", "has_sig": false, "md5_digest": "979f1a528af0fc12e3ec527414ac3ae3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20442, "upload_time": "2017-02-07T21:44:45", "url": "https://files.pythonhosted.org/packages/7c/82/bdd7316872ad043552efd10e33629ca1516c52eeeb441be8c6e535493802/edlib-1.1.2.tar.gz" } ], "1.1.2.post1": [ { "comment_text": "", "digests": { "md5": "527dcd84d83c91a735c7faea028c429c", "sha256": "75c56273222f3bf86751f765e8a8e28f878c18bacdb313f293a58767ad5fe3f5" }, "downloads": -1, "filename": "edlib-1.1.2.post1.tar.gz", "has_sig": false, "md5_digest": "527dcd84d83c91a735c7faea028c429c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20911, "upload_time": "2017-02-16T11:33:41", "url": "https://files.pythonhosted.org/packages/14/ad/ac89f59a299f16a4a3614e1f97a0bb8f8f7db1d783ee22de59e4ca5cba95/edlib-1.1.2.post1.tar.gz" } ], "1.1.2.post2": [ { "comment_text": "", "digests": { "md5": "7845b64e884f5245c83fb3a1f710a383", "sha256": "85b9830b9cda916ddcc2df08e8eb750c513ce6edd5b4f20ca0f27ceb7c70800c" }, "downloads": -1, "filename": "edlib-1.1.2.post2.tar.gz", "has_sig": false, "md5_digest": "7845b64e884f5245c83fb3a1f710a383", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42308, "upload_time": "2017-02-17T09:52:20", "url": "https://files.pythonhosted.org/packages/55/5a/b30cbc5c94ed52e4add0dfe4bad555e4c639a9a20ff60f8a31bbba25a4d5/edlib-1.1.2.post2.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "47b1febfe86445e6ffb749dba1ab27a7", "sha256": "9ce03a30943fb063e1c380815c26aeaa2458b5ebfe68f3007e28081fbfbd513e" }, "downloads": -1, "filename": "edlib-1.2.0.tar.gz", "has_sig": false, "md5_digest": "47b1febfe86445e6ffb749dba1ab27a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47887, "upload_time": "2017-07-30T22:59:03", "url": "https://files.pythonhosted.org/packages/66/1e/2f2896a16c1b7a97d4624b8373432e0feea69e1cf834c820eaebf6376932/edlib-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "afd7cddf64d592e1679bda9adf0a6ead", "sha256": "365147e56715624f616f645daf4cd633aad96e1a39158079ec3fce4de2b5b5a6" }, "downloads": -1, "filename": "edlib-1.2.1.tar.gz", "has_sig": false, "md5_digest": "afd7cddf64d592e1679bda9adf0a6ead", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48027, "upload_time": "2017-09-09T22:03:21", "url": "https://files.pythonhosted.org/packages/e2/4b/eb0a6bdc15c6d4210609232f94848a84c7f5ef414c1dd9d18b271730ce78/edlib-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "372d371298455995c1e2135943ecc5f3", "sha256": "6faa2c8546776769a209d4e171c529afd429d3b5966b798b53c3edf1cd6033e3" }, "downloads": -1, "filename": "edlib-1.2.2.tar.gz", "has_sig": false, "md5_digest": "372d371298455995c1e2135943ecc5f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48351, "upload_time": "2018-02-03T15:34:38", "url": "https://files.pythonhosted.org/packages/27/be/5a1ca9fb06087ffb63a6ad27d274b94776e12a9012c56735054bb3137dd3/edlib-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "ba5443b14120d53d0849f86d4ecbe14e", "sha256": "5f32e02653402f9f649c1e256c39f6fc7361d16fecb2aae6d425c40d4d936be9" }, "downloads": -1, "filename": "edlib-1.2.3.tar.gz", "has_sig": false, "md5_digest": "ba5443b14120d53d0849f86d4ecbe14e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48350, "upload_time": "2018-02-03T15:36:03", "url": "https://files.pythonhosted.org/packages/e6/35/a2bb4755823e44f1ec53c5eaabd2eac3a9a2fcbe36d10f1cc74b1d78f366/edlib-1.2.3.tar.gz" } ], "1.2.3.post1": [ { "comment_text": "", "digests": { "md5": "427a22bba0a2addb67cf654ec463af03", "sha256": "622ea738c177ea1c5f131a137c37599daba55c8d75875d51e93a5a980b2ae5be" }, "downloads": -1, "filename": "edlib-1.2.3.post1.tar.gz", "has_sig": false, "md5_digest": "427a22bba0a2addb67cf654ec463af03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47460, "upload_time": "2018-05-07T23:45:40", "url": "https://files.pythonhosted.org/packages/7b/a1/311f5f1444c35c542952dd5ec347a50fa7288a8c6eecdfced0d9fd5e0ab7/edlib-1.2.3.post1.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "134d269966d3c205c1146d68f153d282", "sha256": "135033711591328c2616650cfe9efc8b2ea1b052c01cc59bfa0d414e65a36bbf" }, "downloads": -1, "filename": "edlib-1.2.4.tar.gz", "has_sig": false, "md5_digest": "134d269966d3c205c1146d68f153d282", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54843, "upload_time": "2019-01-20T21:12:26", "url": "https://files.pythonhosted.org/packages/33/04/0dd73c02c0a5148754a6144df9a7b5dd55ccdbb1b17481bbc89b0193c544/edlib-1.2.4.tar.gz" } ], "1.2.4.post1": [ { "comment_text": "", "digests": { "md5": "54dc99cc32f3e46b3911f3fb78bf407d", "sha256": "f2ab9affa4d7451f2770c0dd36e1a68618a3b845c7cf616dcab899a91d9d35e6" }, "downloads": -1, "filename": "edlib-1.2.4.post1.tar.gz", "has_sig": false, "md5_digest": "54dc99cc32f3e46b3911f3fb78bf407d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82187, "upload_time": "2019-05-04T21:54:52", "url": "https://files.pythonhosted.org/packages/be/6f/52a7b59a1344d851783638699dd9c84cba0223bfb6f285a980f25465aec3/edlib-1.2.4.post1.tar.gz" } ], "1.3.4": [ { "comment_text": "", "digests": { "md5": "87c5033e5d059dbe73aaeb99c2f7ea3f", "sha256": "9ed0fe89ed304ffcfea64c58e55a31119fea94fca1fa9a68a606dd644e17328b" }, "downloads": -1, "filename": "edlib-1.3.4.tar.gz", "has_sig": false, "md5_digest": "87c5033e5d059dbe73aaeb99c2f7ea3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 91332, "upload_time": "2019-08-21T20:03:40", "url": "https://files.pythonhosted.org/packages/ca/d4/dd5429c5ed7fc4bfbfbb96d9c97ca4c3d8b6e0f24f42b09a7db248e1b9d8/edlib-1.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87c5033e5d059dbe73aaeb99c2f7ea3f", "sha256": "9ed0fe89ed304ffcfea64c58e55a31119fea94fca1fa9a68a606dd644e17328b" }, "downloads": -1, "filename": "edlib-1.3.4.tar.gz", "has_sig": false, "md5_digest": "87c5033e5d059dbe73aaeb99c2f7ea3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 91332, "upload_time": "2019-08-21T20:03:40", "url": "https://files.pythonhosted.org/packages/ca/d4/dd5429c5ed7fc4bfbfbb96d9c97ca4c3d8b6e0f24f42b09a7db248e1b9d8/edlib-1.3.4.tar.gz" } ] }