{ "info": { "author": "Daniel Klevebring", "author_email": "daniel.klevebring@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# genomicassertions\n\n[![Build Status](https://travis-ci.org/dakl/genomicassertions.svg?branch=master)](https://travis-ci.org/dakl/genomicassertions)\n[![Coverage Status](https://coveralls.io/repos/github/dakl/genomicassertions/badge.svg?branch=master)](https://coveralls.io/github/dakl/genomicassertions?branch=master)\n[![PyPI version](https://badge.fury.io/py/genomicassertions.svg)](https://badge.fury.io/py/genomicassertions)\n\n`genomicassertions` is a python package which adds methods to test commonly generated files in the genomics field.\n\n# Installation\n\n`pip install genomicassertions`\n\n# Examples\n\nUse the `VariantAssertions` or `ReadAssertions` mixin in your test class to get access to the methods.\n\n## VCF files\n\nFor VCF files, the following methods exist:\n\n* `assertVcfHasVariantAt(vcf, chrom, pos)`\n* `assertVcfHasSample(vcf, sample)`\n* `assertVcfHasVariantWithChromPosRefAlt(vcf, chrom, pos, ref, alt)`\n* `assertVcfHasVariantWithChromPosId(vcf, chrom, pos, variant_id)`\n* `assertVcfHasVariantWithCall(vcf, chrom, pos, sample, call)`\n\n## BAM files\n\n* `assertBamHasCoverageAt(self, bam, coverage, chrom, pos)`\n* `assertBamHasHeaderElement(self, bam, header_element)`\n* `assertBamHeaderElementEquals(self, bam, header_element_name, header_element_value)`\n\n### Examples\n\n#### VCF files\n~~~python\nfrom genomicassertions.variantassertions import VariantAssertions\n\nclass TestVariants(unittest.TestCase, VariantAssertions):\n vcf = \"tests/variants.vcf.gz\"\n vcf_with_genotypes = \"tests/variants-with-genotypes.vcf.gz\"\n\n def test_variant_at(self):\n self.assertVcfHasVariantAt(self.vcf, 3, 178936091)\n\n def test_variant_with_chrom_pos_ref_alt(self):\n self.assertVcfHasVariantWithChromPosRefAlt(self.vcf_with_genotypes, 1, 3062915, 'G', 'C')\n self.assertVcfHasVariantWithChromPosRefAlt(self.vcf_with_genotypes, 1, 3062915, 'G', 'T')\n\n def test_variant_with_id(self):\n self.assertVcfHasVariantWithChromPosId(self.vcf_with_genotypes, 1, 3062915, 'id3D')\n\n~~~\n\n`assertVcfHasVariantWithCall()` asserts that individual items in a sample call are set. The parameter `call` is a dict with the items to test. The dict does not have to be complete, i.e. not all fields in the call have to be tested.\n\n~~~python \n def test_vcf_has_variant_with_call(self):\n self.assertVcfHasVariantWithCall(self.vcf_with_genotypes, 1, 3184885, 'B',\n call={'GT': '1/2', 'DP': 10})\n~~~\n\n#### BAM files\n\n~~~python\nfrom genomicassertions.readassertions import ReadAssertions\n\nclass TestReads(unittest.TestCase, ReadAssertions):\n bam = \"tests/3_178936091.bam\"\n\n # assert coverage as chrom:pos\n def test_has_coverage_as_pos(self):\n self.assertBamHasCoverageAt(self.bam, coverage=324, chrom=3, pos=178936091)\n\n def test_bam_has_header_element(self):\n self.assertBamHasHeaderElement(self.bam, header_element=\"HD\")\n\n def test_header_element_equals(self):\n self.assertBamHeaderElementEquals(self.bam,\n header_element_name='HD',\n header_element_value={'SO': 'coordinate',\n 'VN': '1.3'}\n )\n~~~\n\n\n# File requirements\n\n`genomicassertions` requires the vcf files to be compressed with `bgzip` and indexed with `tabix` in order to work. This is required for the random access to variants provided by the index, which gives a significant performance increase over using non-indexed vcf files. Bam files have to be indexed.\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dakl/genomicassertions/tarball/v0.2.5", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dakl/genomicassertions", "keywords": "testing,genomics", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "genomicassertions", "package_url": "https://pypi.org/project/genomicassertions/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/genomicassertions/", "project_urls": { "Download": "https://github.com/dakl/genomicassertions/tarball/v0.2.5", "Homepage": "https://github.com/dakl/genomicassertions" }, "release_url": "https://pypi.org/project/genomicassertions/0.2.5/", "requires_dist": null, "requires_python": null, "summary": "A package to test common files in genomics (.vcf.gz, .bam)", "version": "0.2.5" }, "last_serial": 2191489, "releases": { "0.2.3": [ { "comment_text": "", "digests": { "md5": "eea7e83c5c37985a76813d99ebd57aef", "sha256": "46e970189f23733c3b5bf5458d710480cf2f3d9db01f836613f73304a7d49cde" }, "downloads": -1, "filename": "genomicassertions-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "eea7e83c5c37985a76813d99ebd57aef", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3837, "upload_time": "2016-06-13T09:16:17", "url": "https://files.pythonhosted.org/packages/cd/7e/9e4bc01ea5998f2a87892cb977643ba65e8749e2f6e8aa18c3d090c30d43/genomicassertions-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c09e2c1f1671c127067c6ee93eed401", "sha256": "e82254fcc5cbcb079bcba726564792c0492fd76533b93beccd090e6aabf7426f" }, "downloads": -1, "filename": "genomicassertions-0.2.3.tar.gz", "has_sig": false, "md5_digest": "8c09e2c1f1671c127067c6ee93eed401", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32748, "upload_time": "2016-06-13T09:16:12", "url": "https://files.pythonhosted.org/packages/cd/05/c3e633e2c614e462e297ef9b707900de91ac250844924c988e1d7314c0f7/genomicassertions-0.2.3.tar.gz" } ], "0.2.4": [], "0.2.5": [ { "comment_text": "", "digests": { "md5": "b6414decd6d0d024a607b91cdc4aad14", "sha256": "00a13fcd04953e3eda88500f13a395a6a08ebec6dd03286a5010122ea8f40da2" }, "downloads": -1, "filename": "genomicassertions-0.2.5.tar.gz", "has_sig": false, "md5_digest": "b6414decd6d0d024a607b91cdc4aad14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32821, "upload_time": "2016-06-28T11:48:29", "url": "https://files.pythonhosted.org/packages/8a/84/6c7342e1099338f435ee2ea2d63e3c5b1fb3bc2f3f0cf51b0d2e2e55d001/genomicassertions-0.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6414decd6d0d024a607b91cdc4aad14", "sha256": "00a13fcd04953e3eda88500f13a395a6a08ebec6dd03286a5010122ea8f40da2" }, "downloads": -1, "filename": "genomicassertions-0.2.5.tar.gz", "has_sig": false, "md5_digest": "b6414decd6d0d024a607b91cdc4aad14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32821, "upload_time": "2016-06-28T11:48:29", "url": "https://files.pythonhosted.org/packages/8a/84/6c7342e1099338f435ee2ea2d63e3c5b1fb3bc2f3f0cf51b0d2e2e55d001/genomicassertions-0.2.5.tar.gz" } ] }