{ "info": { "author": "Peter Griess", "author_email": "pg@std.in", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Software Development :: Libraries" ], "description": "Running NCBI BLAST manually is of course not rocket science, but this\nmodule provides several benefits over doing so:\n\n* Automatically runs a BLAST process for each CPU on the system;\n achieves far better throughput than the ``-num_threads`` option\n* Provides an iterator API that emits native Python objects for each\n BLAST result `as they're produced`, rather than at the end\n* ``Result`` and ``Hit`` objects obviate the need for manually parsing\n results; all values represented by their native Python types (e.g.\n ``Hit.evalue`` is a ``float``, etc)\n\n.. _`NCBI BLAST`: http://blast.ncbi.nlm.nih.gov/\n\nExample\n-------\n\nHere's a simple example with comments hilighting some relevant\nfeatures\n\n::\n\n import pyblast\n \n with open('data.fasta') as f:\n # Use the pyblast.blastx() iterator function\n for r in pyblast.blastx(f, db='/path/to/swissprot'):\n msg = 'query {} has {} hits'.format(r.query_id, len(r.hits))\n if r.hits:\n # Use Hit.evalue as a float for comparison\n min_evalue = sorted([h.evalue for h in r.hits])[0]\n msg += '; minimum evalue {:f}'.format(min_evalue)\n\n print msg\n\nThis will produce output like the following\n\n::\n\n query M00181:167:000000000-A4VBV:1:1101:11880:1874 1:N:0:6 has 6 hits; minimum evalue 0.310000\n query M00181:167:000000000-A4VBV:1:1101:17067:1875 1:N:0:6 has 14 hits; minimum evalue 0.200000\n query M00181:167:000000000-A4VBV:1:1101:15039:1878 1:N:0:6 has 4 hits; minimum evalue 4.400000\n query M00181:167:000000000-A4VBV:1:1101:17090:1895 1:N:0:6 has 6 hits; minimum evalue 1.700000\n query M00181:167:000000000-A4VBV:1:1101:15843:1907 1:N:0:6 has 2 hits; minimum evalue 1.800000\n\n\nAPI\n---\n\n.. _`blastn`:\n\n``blastn(input_file, *args, **kwargs)``\n\nIterator to process the contents of the FASTA ``input_file`` using\n``blastn``; yields `Result`_ objects.\n\nThe ``*args`` and ``**kwargs`` arguments control how `blastn` is\ninvoked. The former are passed as options without values, while the\nlatter are passed as options with values. For example,\n``blastn(some_file, 'ungapped', db='foo/bar')`` will run ``blastn``\nwith the ``-ungapped -db foo/bar`` options.\n\nIn addition, the following keyword arguments are handled specially and\nare not passed on to BLAST:\n\n- ``pb_num_processes``: number of BLAST processes to spawn; default is ``sysconf(SC_NPROCESSORS_ONLN)``\n- ``pb_fields``: iterable of field names to retrieve for each hit; default is `DEFAULT_HIT_FIELDS`_. The list of valid field names (and their meanings) can be found in the ``*** Formatting options`` section of ``blastn -help``.\n\n``blastp(input_file, *args, **kwargs)``\n\nSee documentation for `blastn`_.\n\n``blastx(input_file, *args, **kwargs)``\n\nSee documentation for `blastn`_.\n\n.. _`Result`:\n\n``Result``\n\nThe result of BLAST processing a single query sequence. The set of\nattributes on this object are:\n\n- ``id``: identifier for the query sequence; can be ``None``\n- ``description``: textual description of the query sequence; can be ``None``\n- ``hits``: array of `Hit`_ objects\n\n.. _`Hit`:\n\n``Hit``\n\nA single sequence hit in a `Result`_ object.\n\nThe attributes of this object are the names of the fields requested of\nBLAST. For example, if ``blastn`` was run with ``pb_fields=['qseqid',\n...]`` then one could access the ``qseqid`` value of the ``Hit``\nobject ``h`` like so: ``h.qseqid``. Fields referenced that were not\nrequested of BLAST have a ``None`` value.\n\nIn addition, BLAST fields are converted to their native Python types.\nFor example, ``evalue`` fields are automatically converted to floating\npoint values.\n\n.. _`DEFAULT_HIT_FIELDS`:\n\n``DEFAULT_HIT_FIELDS``\n\nThe default fields returned for each ``Hit`` object.\n\n``VERSION``\n\nThe version of ``pyblast`` that's being used. This can be used to more\neasily than feature detection to determine what features of the module\nare available.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pgriess/pyblast", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyblast", "package_url": "https://pypi.org/project/pyblast/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyblast/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/pgriess/pyblast" }, "release_url": "https://pypi.org/project/pyblast/0.1/", "requires_dist": null, "requires_python": null, "summary": "Run NCBI BLAST with an easy-to-use Pythonic API", "version": "0.1" }, "last_serial": 1103249, "releases": { "0.1": [] }, "urls": [] }