gtfparse


Namegtfparse JSON
Version 2.5.0 PyPI version JSON
download
home_page
SummaryParsing library for extracting data frames of genomic features from GTF files
upload_time2024-01-17 04:42:08
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            <!-- 
[![Build Status](https://travis-ci.org/openvax/gtfparse.svg?branch=master)](https://travis-ci.org/openvax/gtfparse) 
-->
[![Coverage Status](https://coveralls.io/repos/openvax/gtfparse/badge.svg?branch=master&service=github)](https://coveralls.io/github/openvax/gtfparse?branch=master)
<a href="https://pypi.python.org/pypi/gtfparse/">
    <img src="https://img.shields.io/pypi/v/gtfparse.svg?maxAge=1000" alt="PyPI" />
</a>

gtfparse
========
Parsing tools for GTF (gene transfer format) files.

# Example usage

## Parsing all rows of a GTF file into a Pandas DataFrame

```python
from gtfparse import read_gtf

# returns GTF with essential columns such as "feature", "seqname", "start", "end"
# alongside the names of any optional keys which appeared in the attribute column
df = read_gtf("gene_annotations.gtf")

# filter DataFrame to gene entries on chrY
df_genes = df[df["feature"] == "gene"]
df_genes_chrY = df_genes[df_genes["seqname"] == "Y"]
```


## Getting gene FPKM values from a StringTie GTF file

```python
from gtfparse import read_gtf

df = read_gtf(
    "Transcripts.gtf",
    column_converters={"FPKM": float})

gene_fpkms = {
    gene_name: fpkm
    for (gene_name, fpkm, feature)
    in zip(df["seqname"], df["FPKM"], df["feature"])
    if feature == "gene"
}
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gtfparse",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Alex Rubinsteyn <alex.rubinsteyn@unc.edu>",
    "download_url": "https://files.pythonhosted.org/packages/91/e9/f576f57742fe8fcb8086eb72c6de60e75e7adce7f6dc582d34b5143fb1ab/gtfparse-2.5.0.tar.gz",
    "platform": null,
    "description": "<!-- \n[![Build Status](https://travis-ci.org/openvax/gtfparse.svg?branch=master)](https://travis-ci.org/openvax/gtfparse) \n-->\n[![Coverage Status](https://coveralls.io/repos/openvax/gtfparse/badge.svg?branch=master&service=github)](https://coveralls.io/github/openvax/gtfparse?branch=master)\n<a href=\"https://pypi.python.org/pypi/gtfparse/\">\n    <img src=\"https://img.shields.io/pypi/v/gtfparse.svg?maxAge=1000\" alt=\"PyPI\" />\n</a>\n\ngtfparse\n========\nParsing tools for GTF (gene transfer format) files.\n\n# Example usage\n\n## Parsing all rows of a GTF file into a Pandas DataFrame\n\n```python\nfrom gtfparse import read_gtf\n\n# returns GTF with essential columns such as \"feature\", \"seqname\", \"start\", \"end\"\n# alongside the names of any optional keys which appeared in the attribute column\ndf = read_gtf(\"gene_annotations.gtf\")\n\n# filter DataFrame to gene entries on chrY\ndf_genes = df[df[\"feature\"] == \"gene\"]\ndf_genes_chrY = df_genes[df_genes[\"seqname\"] == \"Y\"]\n```\n\n\n## Getting gene FPKM values from a StringTie GTF file\n\n```python\nfrom gtfparse import read_gtf\n\ndf = read_gtf(\n    \"Transcripts.gtf\",\n    column_converters={\"FPKM\": float})\n\ngene_fpkms = {\n    gene_name: fpkm\n    for (gene_name, fpkm, feature)\n    in zip(df[\"seqname\"], df[\"FPKM\"], df[\"feature\"])\n    if feature == \"gene\"\n}\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Parsing library for extracting data frames of genomic features from GTF files",
    "version": "2.5.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/openvax/gtfparse",
        "Homepage": "https://github.com/openvax/gtfparse"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b14b0cb91cedef2b9e93f340166e8709587e3c36366fff4964973ff0d38908ba",
                "md5": "e30b7402e8f082184dfd8c3a7fea3eb1",
                "sha256": "ccc9e9e77b7bdd90dda0e41da864714cb40b6b0c64ecc1d8a131e11497357140"
            },
            "downloads": -1,
            "filename": "gtfparse-2.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e30b7402e8f082184dfd8c3a7fea3eb1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15450,
            "upload_time": "2024-01-17T04:42:06",
            "upload_time_iso_8601": "2024-01-17T04:42:06.597363Z",
            "url": "https://files.pythonhosted.org/packages/b1/4b/0cb91cedef2b9e93f340166e8709587e3c36366fff4964973ff0d38908ba/gtfparse-2.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91e9f576f57742fe8fcb8086eb72c6de60e75e7adce7f6dc582d34b5143fb1ab",
                "md5": "1f6071f804f1db17b731aad4d6b4032f",
                "sha256": "9fea54811cd87f597a110a49dc1b1b6a3325ffb7d1f36ecc62c32d14d3eb9493"
            },
            "downloads": -1,
            "filename": "gtfparse-2.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1f6071f804f1db17b731aad4d6b4032f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 17228,
            "upload_time": "2024-01-17T04:42:08",
            "upload_time_iso_8601": "2024-01-17T04:42:08.218402Z",
            "url": "https://files.pythonhosted.org/packages/91/e9/f576f57742fe8fcb8086eb72c6de60e75e7adce7f6dc582d34b5143fb1ab/gtfparse-2.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 04:42:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openvax",
    "github_project": "gtfparse",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "gtfparse"
}
        
Elapsed time: 0.19684s