{ "info": { "author": "Brent Pedersen", "author_email": "bpederse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Topic :: Database", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Medical Science Apps." ], "description": "A rendered version of the docs is available at: http://pythonhosted.org/cruzdb/\n\nA paper describing cruzdb is in Bioinformatics: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btt534?ijkey=9I8rQeolKOhzFHv&keytype=ref\n\ncruzdb overview\n===============\n\nThe UCSC `Genomes Database`_ is a great resource for annoations, regulation\nand variation and all kinds of data for a growing number of taxa.\nThis library aims to make utilizing that data simple so that we can do\nsophisticated analyses without resorting to `awk-ful`_, error-prone\nmanipulations.\nAs motivation, here's an example of some of the capabilities::\n\n >>> from cruzdb import Genome\n\n >>> g = Genome(db=\"hg18\")\n\n >>> muc5b = g.refGene.filter_by(name2=\"MUC5B\").first()\n >>> muc5b\n refGene(chr11:MUC5B:1200870-1239982)\n\n >>> muc5b.strand\n '+'\n\n # the first 4 introns\n >>> muc5b.introns[:4]\n [(1200999L, 1203486L), (1203543L, 1204010L), (1204082L, 1204420L), (1204682L, 1204836L)]\n\n # the first 4 exons.\n >>> muc5b.exons[:4]\n [(1200870L, 1200999L), (1203486L, 1203543L), (1204010L, 1204082L), (1204420L, 1204682L)]\n\n # note that some of these are not coding because they are < cdsStart\n >>> muc5b.cdsStart\n 1200929L\n\n # the extent of the 5' utr.\n >>> muc5b.utr5\n (1200870L, 1200929L)\n\n # we can get the (first 4) actual CDS's with:\n >>> muc5b.cds[:4]\n [(1200929L, 1200999L), (1203486L, 1203543L), (1204010L, 1204082L), (1204420L, 1204682L)]\n\n # the cds sequence from the UCSC DAS server as a list with one entry per cds\n >>> muc5b.cds_sequence #doctest: +ELLIPSIS\n ['atgggtgccccgagcgcgtgccggacgctggtgttggctctggcggccatgctcgtggtgccgcaggcag', ...]\n\n\n >>> transcript = g.knownGene.filter_by(name=\"uc001aaa.2\").first()\n >>> transcript.is_coding\n False\n\n # convert a genome coordinate to a local coordinate.\n >>> transcript.localize(transcript.txStart)\n 0L\n\n # or localize to the CDNA position.\n >>> print transcript.localize(transcript.cdsStart, cdna=True)\n None\n\nCommand-Line Interface\n======================\n\nwith cruzdb 0.5.4+ installed, given a file `input.bed` you can do::\n\n python -m cruzdb hg18 input.bed refGene cpgIslandExt\n\nto have the intervals annotated with the `refGene` and `cpgIslandExt`\ntables from versoin `hg18`.\n\nDataFrames\n----------\n... are so in. We can get one from a table as::\n\n >>> df = g.dataframe('cpgIslandExt') \n >>> df.columns #doctest: +ELLIPSIS\n Index([chrom, chromStart, chromEnd, name, length, cpgNum, gcNum, perCpg, perGc, obsExp], dtype=object)\n\n\n\nAll of the above can be repeated using knownGene annotations by changing 'refGene' to \n'knownGene'. And, it can be done easily for a set of genes.\n\nSpatial\n-------\n\nk-nearest neighbors, upstream, and downstream searches are available.\nUp and downstream searches use the strand of the query feature to determine the direction:\n\n >>> nearest = g.knearest(\"refGene\", \"chr1\", 9444, 9555, k=6)\n >>> up_list = g.upstream(\"refGene\", \"chr1\", 9444, 9555, k=6)\n >>> down_list = g.downstream(\"refGene\", \"chr1\", 9444, 9555, k=6)\n\n\n\nMirror\n------\n\nThe above uses the mysql interface from UCSC. It is now possible to mirror\nany tables from UCSC to a local sqlite database via:\n\n # cleanup\n\n >>> import os\n >>> if os.path.exists(\"/tmp/u.db\"): os.unlink('/tmp/u.db')\n\n >>> g = Genome('hg18')\n\n\n\n >>> gs = g.mirror(['chromInfo'], 'sqlite:////tmp/u.db')\n\nand then use as:\n\n >>> gs.chromInfo\n \n\n\nCode\n----\n\nMost of the per-row features are implemented in `cruzdb/models.py` in the\nFeature class. If you want to add something to a feature (like the existing\nfeature.utr5) add it here.\n\nThe tables are reflected using `sqlalchemy`_ and mapped in the\n\\_\\_getattr\\_\\_\\ method of the `Genome` class in `cruzdb/__init__.py`\n\nSo a call like::\n\n genome.knownGene\n\ncalls the \\_\\_getattr\\_\\_ method with the table arg set to 'knownGene'\nthat table is then reflected and an object with parent classes of `Feature`\nand sqlalchemy's declarative_base is returned.\n\n\nContributing\n------------\n\nYES PLEASE!\n\nTo start coding, it is probably polite to grab your own copy of some of the\nUCSC tables so as not to overload the UCSC server. \nYou can run something like::\n\n Genome('hg18').mirror([\"refGene\", \"cpgIslandExt\", \"chromInfo\", \"knownGene\", \"kgXref\"], \"sqlite:////tmp/hg18.db\")\n\nThen the connection would be something like::\n\n g = Genome(\"sqlite:////tmp/hg18.db\")\n\nIf you have a feature you like to use/implement, open a ticket on github for\ndiscussion. Below are some ideas.\n\n\n.. _`Genomes Database`: http://genome.ucsc.edu/cgi-bin/hgTables\n.. _`awk-ful`: https://gist.github.com/1173596\n.. _`sqlalchemy`: http://sqlalchemy.org/", "description_content_type": null, "docs_url": "https://pythonhosted.org/cruzdb/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brentp/cruzdb/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "cruzdb", "package_url": "https://pypi.org/project/cruzdb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cruzdb/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/brentp/cruzdb/" }, "release_url": "https://pypi.org/project/cruzdb/0.5.6/", "requires_dist": null, "requires_python": null, "summary": "Interface to UCSC genomic databases.\nAlso allows things like up/downstream/k-nearest-neighbor queries and mirroring\nof tables to local sqlite databases", "version": "0.5.6" }, "last_serial": 1152445, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d927521cf9b89c9e14fa63b7c97ab5d5", "sha256": "35b1a1053aef4f3b171ffc8d4229a581f7b1936eed3123f59d14c96007febe18" }, "downloads": -1, "filename": "cruzdb-0.1.tar.gz", "has_sig": false, "md5_digest": "d927521cf9b89c9e14fa63b7c97ab5d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9241, "upload_time": "2012-10-16T02:49:39", "url": "https://files.pythonhosted.org/packages/f6/ec/2201398e17da373578403a6853b470cf5ea5e94a6ad6135f99ff0fd0f0c3/cruzdb-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "dd0dff1879395b069c29ec9c6496491a", "sha256": "37a6769140bcbaea956fdad9828fed39391247314389a356f9f5bb4bf793a79f" }, "downloads": -1, "filename": "cruzdb-0.2.tar.gz", "has_sig": false, "md5_digest": "dd0dff1879395b069c29ec9c6496491a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11997, "upload_time": "2012-11-14T18:20:52", "url": "https://files.pythonhosted.org/packages/e7/96/b332e3fe3afbb6fa3def6c99777aacc672eaec39803b15a4875319e35a0f/cruzdb-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "169311e4ff07fd86057b28cb3b840283", "sha256": "057140611402ec6fb6635a599bc824a5887f293176b0b59c1e2b38f8f7a47b48" }, "downloads": -1, "filename": "cruzdb-0.3.tar.gz", "has_sig": false, "md5_digest": "169311e4ff07fd86057b28cb3b840283", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22129, "upload_time": "2012-12-16T18:07:58", "url": "https://files.pythonhosted.org/packages/ef/0b/25355efd78c3293c5ff5b5f6010a6a091115490288e75a439c701b6ccbde/cruzdb-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f68c525e6734702e8ea15b012c1a9b64", "sha256": "c841e6e865c1764f9b4760572010d8c3349106218abc81bfe7ce2a861a7a9e3b" }, "downloads": -1, "filename": "cruzdb-0.4.tar.gz", "has_sig": false, "md5_digest": "f68c525e6734702e8ea15b012c1a9b64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27145, "upload_time": "2013-03-06T20:33:34", "url": "https://files.pythonhosted.org/packages/bd/eb/6809c83a21159fd637e458dfda1abd04ebbc0c543b62a03c1251720d6cf3/cruzdb-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "e2132bf01920da3a87329e16d16a7325", "sha256": "4ed340d8ed12d575acd26670d7251352b2865265d3089dc7495637982186c742" }, "downloads": -1, "filename": "cruzdb-0.5.tar.gz", "has_sig": false, "md5_digest": "e2132bf01920da3a87329e16d16a7325", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27982, "upload_time": "2013-07-19T17:03:30", "url": "https://files.pythonhosted.org/packages/89/94/84a4a9cec910f824002f2bb3b41895dfaf8fe4675a409f926d65c7aa7aac/cruzdb-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "7c46f35680b4ada7eb80e6fddbce7541", "sha256": "45b91fa43f7c1173be7c5dc9060f19692c3dc0da00fc1eb8253ffaf27e6f8c30" }, "downloads": -1, "filename": "cruzdb-0.5.1.tar.gz", "has_sig": false, "md5_digest": "7c46f35680b4ada7eb80e6fddbce7541", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27656, "upload_time": "2013-09-13T12:21:49", "url": "https://files.pythonhosted.org/packages/d1/75/0f36a960fdebc336a124278752afd5d0ca5c9752a9be2da77e2c697d7b22/cruzdb-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "cc3d33a8b517f7e6ed4d9a3b37776f68", "sha256": "10c89bed2e7736f9ddaa287e2f773efa6807ed9452124f1c08a8e25b91c50174" }, "downloads": -1, "filename": "cruzdb-0.5.2.tar.gz", "has_sig": false, "md5_digest": "cc3d33a8b517f7e6ed4d9a3b37776f68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27806, "upload_time": "2013-09-23T22:20:04", "url": "https://files.pythonhosted.org/packages/69/de/b449c002642cbcde1edfe59070b0f306ce2d6ea8041edefa4d9131eb6f5d/cruzdb-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "e048000ca1a7c15bcc80039ed8012c40", "sha256": "cc204fb04ff7974224b142919fc2a5290ea2f77b16dbc675aae28ceeeb55b09b" }, "downloads": -1, "filename": "cruzdb-0.5.3.tar.gz", "has_sig": false, "md5_digest": "e048000ca1a7c15bcc80039ed8012c40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28284, "upload_time": "2013-10-02T15:31:08", "url": "https://files.pythonhosted.org/packages/54/18/251766b32d036fae8e93803c16503ab162ff90c886e1b7fddad5d2d167ae/cruzdb-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "bf65f1c4589e0df2d32bbef4e92be799", "sha256": "42b8da2c4c68b06782a23af48ac04c822a8e12f21165a944b999c3ba7d684e76" }, "downloads": -1, "filename": "cruzdb-0.5.4.tar.gz", "has_sig": false, "md5_digest": "bf65f1c4589e0df2d32bbef4e92be799", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28329, "upload_time": "2013-10-23T12:50:32", "url": "https://files.pythonhosted.org/packages/be/aa/ceaa43b60cc94416524559b4f80d205a7cb753917da7956e2585606a861a/cruzdb-0.5.4.tar.gz" } ], "0.5.6": [ { "comment_text": "", "digests": { "md5": "b735a3c2f007a3e5f7cf9c0db512b54f", "sha256": "db53459768b35daa1c0f7f0dd16796d51e1ff3a1558962bfc20fab1f0a14c7f4" }, "downloads": -1, "filename": "cruzdb-0.5.6.tar.gz", "has_sig": false, "md5_digest": "b735a3c2f007a3e5f7cf9c0db512b54f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29380, "upload_time": "2014-07-09T17:24:38", "url": "https://files.pythonhosted.org/packages/07/bd/af49692ea709c50da87b2532bf067b42b27efad5f2939e870cdb8c0ee3b9/cruzdb-0.5.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b735a3c2f007a3e5f7cf9c0db512b54f", "sha256": "db53459768b35daa1c0f7f0dd16796d51e1ff3a1558962bfc20fab1f0a14c7f4" }, "downloads": -1, "filename": "cruzdb-0.5.6.tar.gz", "has_sig": false, "md5_digest": "b735a3c2f007a3e5f7cf9c0db512b54f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29380, "upload_time": "2014-07-09T17:24:38", "url": "https://files.pythonhosted.org/packages/07/bd/af49692ea709c50da87b2532bf067b42b27efad5f2939e870cdb8c0ee3b9/cruzdb-0.5.6.tar.gz" } ] }