{ "info": { "author": "Marcus D. R. Klarqvist", "author_email": "mk819@cam.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics" ], "description": "# pyflagstats\n\n[![PyPI version](https://badge.fury.io/py/pyflagstats.svg)](https://badge.fury.io/py/pyflagstats)\n\nGiven a stream of k-bit words, we seek to sum the bit values at indexes 0, 1, 2,\n..., k-1 across multiple words by computing k distinct sums. If the k-bit words\nare one-hot encoded then the sums corresponds to their frequencies.\n\nThis multiple-sum problem is a generalization of the population-count problem\nwhere we count the total number of set bits in independent machine words. We\nrefer to this new problem as the positional population-count problem.\n\nUsing SIMD (Single Instruction, Multiple Data) instructions from recent Intel\nprocessors, we describe algorithms for computing the 16-bit position population\ncount using about one eighth (0.125) of a CPU cycle per 16-bit word. Our best\napproach is about 140-fold faster than competitive code using only non-SIMD\ninstructions in terms of CPU cycles.\n\nThis package contains native Python bindings for the applying the efficient\npositional population count operator to computing summary statistics for the SAM\nFLAG field\n\n## Intallation\n\nInstall with\n```bash\npip3 install .\n```\n\nor locally with\n```bash\npython3 setup.py build_ext --inplace\n```\n\nUninstall with\n```bash\npip3 uninstall pyflagstats\n```\n\n## Example\n\n```python\nimport numpy as np\nimport pyflagstats as fs\n\n# Compute summary statistics for 100 million random FLAG fields.\n# Completes in around 1 second.\nfs.flagstats(np.random.randint(0,8192,100000000,dtype=\"uint16\"))\n```\n\nreturns (for example)\n\n```\n{'passed': array([ 624787, 312748, 2500089, 312384, 312314, 312678, 312045,\n 311845, 2499502, 4999279, 2497500, 1248979, 389744, 156194,\n 156029, 0], dtype=uint32), 'failed': array([ 625143, 312906, 2498840, 312818, 312129, 312802, 311869,\n 312105, 2501477, 5000721, 2499178, 1249105, 390962, 155828,\n 156018, 0], dtype=uint32)}\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mklarqvist/libflagstats", "keywords": "simd,popcount,popcnt,pospopcnt,hts,ngs,flags", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pyflagstats", "package_url": "https://pypi.org/project/pyflagstats/", "platform": "Linux", "project_url": "https://pypi.org/project/pyflagstats/", "project_urls": { "Homepage": "https://github.com/mklarqvist/libflagstats" }, "release_url": "https://pypi.org/project/pyflagstats/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Efficient subroutines for computing summary statistics for the SAM FLAG field", "version": "0.1.3" }, "last_serial": 5907139, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "098105567b030a417539acdea892bbb8", "sha256": "7d8692983e33be3026ca9a2c0be7c5e724e0d6209e76be17528481e5b8ebe4cb" }, "downloads": -1, "filename": "pyflagstats-0.1.0.tar.gz", "has_sig": false, "md5_digest": "098105567b030a417539acdea892bbb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28391, "upload_time": "2019-09-30T13:00:20", "url": "https://files.pythonhosted.org/packages/b3/dc/d92e22efbc38673ebe0e6fa691c654daf3ed3965b4a2f81052ae02daefe3/pyflagstats-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "60606c5aa85c397ab456527b53b7e81b", "sha256": "ea92e49673a78a4707ce5623b9058a1740446bedf0ea80c01f3211efd52679f2" }, "downloads": -1, "filename": "pyflagstats-0.1.1.tar.gz", "has_sig": false, "md5_digest": "60606c5aa85c397ab456527b53b7e81b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 145890, "upload_time": "2019-09-30T13:16:40", "url": "https://files.pythonhosted.org/packages/4a/f4/cef261eeb21acc8760d247565bbfb921d8f0007ed22dd9c1f9a38c4596ea/pyflagstats-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c1d2679b6f805a06450108530d9126cc", "sha256": "976487d202323a6e9a055e9505ff23f7a9579050752f1b04727f96e5740681f9" }, "downloads": -1, "filename": "pyflagstats-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c1d2679b6f805a06450108530d9126cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 146706, "upload_time": "2019-09-30T13:29:02", "url": "https://files.pythonhosted.org/packages/34/1a/db61ac32c61915c614af8d7b68fa4d46a354bb338835b566a0b5766a338f/pyflagstats-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8829e870edec6cffc0f281ccac3aaf87", "sha256": "a9e1ea73bc6cd43b11223b3f0332fc0da205ec81a4c57de3c5a0848bd1eb8290" }, "downloads": -1, "filename": "pyflagstats-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8829e870edec6cffc0f281ccac3aaf87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 148691, "upload_time": "2019-09-30T14:20:37", "url": "https://files.pythonhosted.org/packages/02/43/3984505c25ac6e707e31953383a3a932d1d0103eb88ae338984c719d919a/pyflagstats-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8829e870edec6cffc0f281ccac3aaf87", "sha256": "a9e1ea73bc6cd43b11223b3f0332fc0da205ec81a4c57de3c5a0848bd1eb8290" }, "downloads": -1, "filename": "pyflagstats-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8829e870edec6cffc0f281ccac3aaf87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 148691, "upload_time": "2019-09-30T14:20:37", "url": "https://files.pythonhosted.org/packages/02/43/3984505c25ac6e707e31953383a3a932d1d0103eb88ae338984c719d919a/pyflagstats-0.1.3.tar.gz" } ] }