{ "info": { "author": "Heng Li", "author_email": "lh3@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: C", "Programming Language :: Cython", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics" ], "description": "==============================\nMappy: Minimap2 Python Binding\n==============================\n\nMappy provides a convenient interface to `minimap2\n`_, a fast and accurate C program to align\ngenomic and transcribe nucleotide sequences.\n\nInstallation\n------------\n\nMappy depends on `zlib `_. It can be installed with `pip\n`_:\n\n.. code:: shell\n\n\tpip install --user mappy\n\nor from the minimap2 github repo (`Cython `_ required):\n\n.. code:: shell\n\n\tgit clone https://github.com/lh3/minimap2\n\tcd minimap2\n\tpython setup.py install\n\nUsage\n-----\n\nThe following Python script demonstrates the key functionality of mappy:\n\n.. code:: python\n\n\timport mappy as mp\n\ta = mp.Aligner(\"test/MT-human.fa\") # load or build index\n\tif not a: raise Exception(\"ERROR: failed to load/build index\")\n\ts = a.seq(\"MT_human\", 100, 200) # retrieve a subsequence from the index\n\tprint(mp.revcomp(s)) # reverse complement\n\tfor name, seq, qual in mp.fastx_read(\"test/MT-orang.fa\"): # read a fasta/q sequence\n\t\tfor hit in a.map(seq): # traverse alignments\n\t\t\tprint(\"{}\\t{}\\t{}\\t{}\".format(hit.ctg, hit.r_st, hit.r_en, hit.cigar_str))\n\nAPIs\n----\n\nMappy implements two classes and two global function.\n\nClass mappy.Aligner\n~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n\tmappy.Aligner(fn_idx_in=None, preset=None, ...)\n\nThis constructor accepts the following arguments:\n\n* **fn_idx_in**: index or sequence file name. Minimap2 automatically tests the\n file type. If a sequence file is provided, minimap2 builds an index. The\n sequence file can be optionally gzip'd. This option has no effect if **seq**\n is set.\n\n* **seq**: a single sequence to index. The sequence name will be set to\n :code:`N/A`.\n\n* **preset**: minimap2 preset. Currently, minimap2 supports the following\n presets: **sr** for single-end short reads; **map-pb** for PacBio\n read-to-reference mapping; **map-ont** for Oxford Nanopore read mapping;\n **splice** for long-read spliced alignment; **asm5** for assembly-to-assembly\n alignment; **asm10** for full genome alignment of closely related species. Note\n that the Python module does not support all-vs-all read overlapping.\n\n* **k**: k-mer length, no larger than 28\n\n* **w**: minimizer window size, no larger than 255\n\n* **min_cnt**: mininum number of minimizers on a chain\n\n* **min_chain_score**: minimum chaing score\n\n* **bw**: chaining and alignment band width\n\n* **best_n**: max number of alignments to return\n\n* **n_threads**: number of indexing threads; 3 by default\n\n* **extra_flags**: additional flags defined in minimap.h\n\n* **fn_idx_out**: name of file to which the index is written. This parameter\n has no effect if **seq** is set.\n\n* **scoring**: scoring system. It is a tuple/list consisting of 4, 6 or 7\n positive integers. The first 4 elements specify match scoring, mismatch\n penalty, gap open and gap extension penalty. The 5th and 6th elements, if\n present, set long-gap open and long-gap extension penalty. The 7th sets a\n mismatch penalty involving ambiguous bases.\n\n.. code:: python\n\n\tmappy.Aligner.map(seq, seq2=None, cs=False, MD=False)\n\nThis method aligns :code:`seq` against the index. It is a generator, *yielding*\na series of :code:`mappy.Alignment` objects. If :code:`seq2` is present, mappy\nperforms paired-end alignment, assuming the two ends are in the FR orientation.\nAlignments of the two ends can be distinguished by the :code:`read_num` field\n(see Class mappy.Alignment below). Argument :code:`cs` asks mappy to generate\nthe :code:`cs` tag; :code:`MD` is similar. These two arguments might slightly\ndegrade performance and are not enabled by default.\n\n.. code:: python\n\n\tmappy.Aligner.seq(name, start=0, end=0x7fffffff)\n\nThis method retrieves a (sub)sequence from the index and returns it as a Python\nstring. :code:`None` is returned if :code:`name` is not present in the index or\nthe start/end coordinates are invalid.\n\n.. code:: python\n\n\tmappy.Aligner.seq_names\n\nThis property gives the array of sequence names in the index.\n\nClass mappy.Alignment\n~~~~~~~~~~~~~~~~~~~~~\n\nThis class describes an alignment. An object of this class has the following\nproperties:\n\n* **ctg**: name of the reference sequence the query is mapped to\n\n* **ctg_len**: total length of the reference sequence\n\n* **r_st** and **r_en**: start and end positions on the reference\n\n* **q_st** and **q_en**: start and end positions on the query\n\n* **strand**: +1 if on the forward strand; -1 if on the reverse strand\n\n* **mapq**: mapping quality\n\n* **blen**: length of the alignment, including both alignment matches and gaps\n but excluding ambiguous bases.\n\n* **mlen**: length of the matching bases in the alignment, excluding ambiguous\n base matches.\n\n* **NM**: number of mismatches, gaps and ambiguous poistions in the alignment\n\n* **trans_strand**: transcript strand. +1 if on the forward strand; -1 if on the\n reverse strand; 0 if unknown\n\n* **is_primary**: if the alignment is primary (typically the best and the first\n to generate)\n\n* **read_num**: read number that the alignment corresponds to; 1 for the first\n read and 2 for the second read\n\n* **cigar_str**: CIGAR string\n\n* **cigar**: CIGAR returned as an array of shape :code:`(n_cigar,2)`. The two\n numbers give the length and the operator of each CIGAR operation.\n\n* **MD**: the :code:`MD` tag as in the SAM format. It is an empty string unless\n the :code:`MD` argument is applied when calling :code:`mappy.Aligner.map()`.\n\n* **cs**: the :code:`cs` tag.\n\nAn :code:`Alignment` object can be converted to a string with :code:`str()` in\nthe following format:\n\n::\n\n\tq_st q_en strand ctg ctg_len r_st r_en mlen blen mapq cg:Z:cigar_str\n\nIt is effectively the PAF format without the QueryName and QueryLength columns\n(the first two columns in PAF).\n\nMiscellaneous Functions\n~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n\tmappy.fastx_read(fn, read_comment=False)\n\nThis generator function opens a FASTA/FASTQ file and *yields* a\n:code:`(name,seq,qual)` tuple for each sequence entry. The input file may be\noptionally gzip'd. If :code:`read_comment` is True, this generator yields\na :code:`(name,seq,qual,comment)` tuple instead.\n\n.. code:: python\n\n\tmappy.revcomp(seq)\n\nReturn the reverse complement of DNA string :code:`seq`. This function\nrecognizes IUB code and preserves the letter cases. Uracil :code:`U` is\ncomplemented to :code:`A`.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lh3/minimap2", "keywords": "sequence-alignment", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mappy", "package_url": "https://pypi.org/project/mappy/", "platform": "", "project_url": "https://pypi.org/project/mappy/", "project_urls": { "Homepage": "https://github.com/lh3/minimap2" }, "release_url": "https://pypi.org/project/mappy/2.17/", "requires_dist": null, "requires_python": "", "summary": "Minimap2 python binding", "version": "2.17" }, "last_serial": 5227387, "releases": { "2.10": [ { "comment_text": "", "digests": { "md5": "956578c92dc5753904ad4d72792f9372", "sha256": "012a5f4df1ffa7bef98b22baaf904e0b4ea209ae0621805e630397b9e9f03032" }, "downloads": -1, "filename": "mappy-2.10.tar.gz", "has_sig": false, "md5_digest": "956578c92dc5753904ad4d72792f9372", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 160028, "upload_time": "2018-03-27T16:05:28", "url": "https://files.pythonhosted.org/packages/75/53/3546f8999d584f5a98b4896248e7b6743d91ec8e8a51ff98b7a3399b9e7c/mappy-2.10.tar.gz" } ], "2.11": [ { "comment_text": "", "digests": { "md5": "c8704fe2ea171da339992dd23536ca47", "sha256": "3a76eb65a9a8add70d59e4e733c7cfdbf3ec7995435a6913143f54bdf6433461" }, "downloads": -1, "filename": "mappy-2.11.tar.gz", "has_sig": false, "md5_digest": "c8704fe2ea171da339992dd23536ca47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 162155, "upload_time": "2018-06-21T04:21:43", "url": "https://files.pythonhosted.org/packages/06/2b/da43e25c712c0ab13f3357ee84b4e697f4c420f188694ce8bafcdb77f992/mappy-2.11.tar.gz" } ], "2.12": [ { "comment_text": "", "digests": { "md5": "5d82342581d62460aa6b71a84a707c7e", "sha256": "54645383ef0ca447b14a28d4621f87052c4b383443a4445f2ccd443c53279573" }, "downloads": -1, "filename": "mappy-2.12.tar.gz", "has_sig": false, "md5_digest": "5d82342581d62460aa6b71a84a707c7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 186347, "upload_time": "2018-08-06T16:55:03", "url": "https://files.pythonhosted.org/packages/16/96/5382b6d4b5be5b5752cbbaa65cd04b0045e483afd73f3ec5f22e010b3f09/mappy-2.12.tar.gz" } ], "2.13": [ { "comment_text": "", "digests": { "md5": "b5611bbd15d37b36864a0c04447e1ae3", "sha256": "6a5008d53a44b157f39c5578fa6dce33ef3989270156f5e0a8fa08a19cfed21e" }, "downloads": -1, "filename": "mappy-2.13.tar.gz", "has_sig": false, "md5_digest": "b5611bbd15d37b36864a0c04447e1ae3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 193262, "upload_time": "2018-10-11T17:38:32", "url": "https://files.pythonhosted.org/packages/72/d2/35f1355e8b0c5f24ff06f4036d4680d2216ac5a43eead0c14e2981d30faf/mappy-2.13.tar.gz" } ], "2.14": [ { "comment_text": "", "digests": { "md5": "ae43edf1d9806104f14b937b2b487e9c", "sha256": "3015c03141d3c7378329910f920d43739e569302245d602c60c31a9c5e864525" }, "downloads": -1, "filename": "mappy-2.14.tar.gz", "has_sig": false, "md5_digest": "ae43edf1d9806104f14b937b2b487e9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 195240, "upload_time": "2018-11-06T05:17:32", "url": "https://files.pythonhosted.org/packages/25/fe/767b7854cde9fe3ea759d215b2af1ad4a81025a659d1071e2e1ff6327e34/mappy-2.14.tar.gz" } ], "2.15": [ { "comment_text": "", "digests": { "md5": "ad6959f9840c5512ed09bba8925a3a4c", "sha256": "78881c69e3b5c8422a3379819902204e78f6ae51b1e1b96754d6fc41efa41a3d" }, "downloads": -1, "filename": "mappy-2.15.tar.gz", "has_sig": false, "md5_digest": "ad6959f9840c5512ed09bba8925a3a4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 195460, "upload_time": "2019-01-10T17:44:14", "url": "https://files.pythonhosted.org/packages/0d/66/8e1170f36283f45743e3e6e923a513e2386d5df93e935daba27e7e0d2ad6/mappy-2.15.tar.gz" } ], "2.16": [ { "comment_text": "", "digests": { "md5": "e3114e72c51e7c6d50a097c9d33e3dde", "sha256": "5c30f2196c0da8fc88a88147be2e035d3f5123fd6798a4ea4f8d854e5b040e4f" }, "downloads": -1, "filename": "mappy-2.16.tar.gz", "has_sig": false, "md5_digest": "e3114e72c51e7c6d50a097c9d33e3dde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 196667, "upload_time": "2019-02-28T21:01:25", "url": "https://files.pythonhosted.org/packages/24/90/5c09ce690ffb05a9f33782637e72ee09957e816978175fad2809ba848865/mappy-2.16.tar.gz" } ], "2.17": [ { "comment_text": "", "digests": { "md5": "b9e47b3fdba68b68cd0d846f5ba0d8d0", "sha256": "ed1460efc9c6785df28065b7e93e93c92227f623a181f1a852dca6e6acb1a15f" }, "downloads": -1, "filename": "mappy-2.17.tar.gz", "has_sig": false, "md5_digest": "b9e47b3fdba68b68cd0d846f5ba0d8d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 199280, "upload_time": "2019-05-05T03:56:32", "url": "https://files.pythonhosted.org/packages/86/f7/a8ad5d723681c3e3fcd3ccdf4a593e4b0c8ff961b9933d612a11ac5b5915/mappy-2.17.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "dfc2aefe98376124beb81ce7dcefeccb", "sha256": "3e997012313e32317719b60ee3092e64d8e29d132f21ac9821f187523e409f1d" }, "downloads": -1, "filename": "mappy-2.2.tar.gz", "has_sig": false, "md5_digest": "dfc2aefe98376124beb81ce7dcefeccb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123189, "upload_time": "2017-09-18T00:25:00", "url": "https://files.pythonhosted.org/packages/58/8b/fb2bd61a688b23eceb48b3706ec858a2c903a8cfca3ba9d1a85fd86481f6/mappy-2.2.tar.gz" } ], "2.2rc0": [ { "comment_text": "", "digests": { "md5": "0600b968d7d796cd8dfa96d992c89774", "sha256": "a18537193a3ec01658d114c61bfd2e5b023c336c7f7a468b536e51b8f0f49766" }, "downloads": -1, "filename": "mappy-2.2rc0.tar.gz", "has_sig": false, "md5_digest": "0600b968d7d796cd8dfa96d992c89774", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 119164, "upload_time": "2017-09-17T04:09:55", "url": "https://files.pythonhosted.org/packages/10/63/46fb16e567cdbd081b6b8e5915813f43feb7cb1e449f8a875832fab5601d/mappy-2.2rc0.tar.gz" } ], "2.2rc1": [ { "comment_text": "", "digests": { "md5": "aebcbd85b73d85cdd8d9738d8b4d5212", "sha256": "8391d6a2b74a158d47af97718cc06b1555a79e0d324a1a1c3526fa2ab791633b" }, "downloads": -1, "filename": "mappy-2.2rc1.tar.gz", "has_sig": false, "md5_digest": "aebcbd85b73d85cdd8d9738d8b4d5212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123141, "upload_time": "2017-09-17T21:10:35", "url": "https://files.pythonhosted.org/packages/3a/b2/6b13928a3e73e93d147be2a04c2fb4d4ffdd69a2d080bba4dd7ecab455de/mappy-2.2rc1.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "0be0924ea74f25cae3875cf8ae217d52", "sha256": "238bb937744dae505d7375bbd0bebb9b25d0e7c6476d1db465471b0074fa5339" }, "downloads": -1, "filename": "mappy-2.3.tar.gz", "has_sig": false, "md5_digest": "0be0924ea74f25cae3875cf8ae217d52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 140029, "upload_time": "2017-10-23T16:52:33", "url": "https://files.pythonhosted.org/packages/83/54/0048e0ba59e38d5b43c7500ef56acd877295f6958daeb023eeabeeab3037/mappy-2.3.tar.gz" } ], "2.4": [ { "comment_text": "", "digests": { "md5": "9634e623007dbf0896a546b21af88af4", "sha256": "25e2681c20a72c0425358380a8890eed9d4c21177e64d6bc973f597b3f03e87f" }, "downloads": -1, "filename": "mappy-2.4.tar.gz", "has_sig": false, "md5_digest": "9634e623007dbf0896a546b21af88af4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 140432, "upload_time": "2017-11-06T18:06:33", "url": "https://files.pythonhosted.org/packages/d2/d6/0ffc96dccd542d5bafbd52fab392f208038c174337dd6d378715f97fb6ab/mappy-2.4.tar.gz" } ], "2.5": [ { "comment_text": "", "digests": { "md5": "9689d3e8869cc551728ce4f5c950e222", "sha256": "a2615232af1ac9d59192bc04efabc8962158a3aebe18dd83e4c15ffc377e4442" }, "downloads": -1, "filename": "mappy-2.5.tar.gz", "has_sig": false, "md5_digest": "9689d3e8869cc551728ce4f5c950e222", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 141556, "upload_time": "2017-11-11T16:48:31", "url": "https://files.pythonhosted.org/packages/18/4d/644f97227a7c4ed4af5c96c59ac3f2041fe902d55331ffc1914f66cffcac/mappy-2.5.tar.gz" } ], "2.6": [ { "comment_text": "", "digests": { "md5": "abdf5596d24b031d94c4fc368e60c944", "sha256": "c4c49eec4b1b6e0c676e1e68a534d893f413fc04f473f38d286c1c357650f508" }, "downloads": -1, "filename": "mappy-2.6.tar.gz", "has_sig": false, "md5_digest": "abdf5596d24b031d94c4fc368e60c944", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 143714, "upload_time": "2017-12-12T16:27:57", "url": "https://files.pythonhosted.org/packages/b8/32/d81eecf7ca857a0a1e85ca4ce5b9462aeb33ec1473d993bbe22c7f2f7fa7/mappy-2.6.tar.gz" } ], "2.7": [ { "comment_text": "", "digests": { "md5": "af12d477a0d26a2e64c6118e6fa312a7", "sha256": "c690b8a5aff8dc450d4cb7d5b2013330e0fa6340612fa5f7aaa74f0f5085e4a8" }, "downloads": -1, "filename": "mappy-2.7.tar.gz", "has_sig": false, "md5_digest": "af12d477a0d26a2e64c6118e6fa312a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 144689, "upload_time": "2018-01-09T18:25:20", "url": "https://files.pythonhosted.org/packages/a3/91/0a6ab427f06c4c1ac8e8e06a198d1389a0aeb61546ab84a8d37fa48f5f79/mappy-2.7.tar.gz" } ], "2.8": [ { "comment_text": "", "digests": { "md5": "d2f228e99e33930c28728811ecb48f24", "sha256": "7e7b26ed6c93fb6e3b9bd01df36c8ee55a4516d410057cd6ebef3a6d684f4542" }, "downloads": -1, "filename": "mappy-2.8.tar.gz", "has_sig": false, "md5_digest": "d2f228e99e33930c28728811ecb48f24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 148046, "upload_time": "2018-02-01T17:36:11", "url": "https://files.pythonhosted.org/packages/58/41/f32c6cbdf9bd6018ab03069619a498464a31a55b9f3a967d45bac8d985cb/mappy-2.8.tar.gz" } ], "2.9": [ { "comment_text": "", "digests": { "md5": "35363752b5d25e9d7d08a27df584b9f9", "sha256": "49b2b784e4003358e1ef16d42900be73743cffd61bb91705b3fa6aebae1ccdfd" }, "downloads": -1, "filename": "mappy-2.9.tar.gz", "has_sig": false, "md5_digest": "35363752b5d25e9d7d08a27df584b9f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 153842, "upload_time": "2018-02-24T14:47:30", "url": "https://files.pythonhosted.org/packages/bf/a1/cab71a31aa1c3828fcab98a277b3a98dcef1a2bd6be0ab416c37808996b1/mappy-2.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b9e47b3fdba68b68cd0d846f5ba0d8d0", "sha256": "ed1460efc9c6785df28065b7e93e93c92227f623a181f1a852dca6e6acb1a15f" }, "downloads": -1, "filename": "mappy-2.17.tar.gz", "has_sig": false, "md5_digest": "b9e47b3fdba68b68cd0d846f5ba0d8d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 199280, "upload_time": "2019-05-05T03:56:32", "url": "https://files.pythonhosted.org/packages/86/f7/a8ad5d723681c3e3fcd3ccdf4a593e4b0c8ff961b9933d612a11ac5b5915/mappy-2.17.tar.gz" } ] }