Skip to main content

GTF Parsing

Project description

Temporary fix for gtfparse to work with polars>0.16, based on https://github.com/y9c/gtfparse

gtfparse

Parsing tools for GTF (gene transfer format) files.

Example usage

Parsing all rows of a GTF file into a Pandas DataFrame

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

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"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtfparse_transcript_transformer-2.0.3.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file gtfparse_transcript_transformer-2.0.3.tar.gz.

File metadata

File hashes

Hashes for gtfparse_transcript_transformer-2.0.3.tar.gz
Algorithm Hash digest
SHA256 75784bee1be908fd077f3593dad34cde3d5bf1a59917d808114fbc919beb1a77
MD5 c63cad799b175f0330b7785388a1bd60
BLAKE2b-256 71b6d6ca447009323e4038a4691b97aaf66979df958357797c1e4d0393dc5478

See more details on using hashes here.

File details

Details for the file gtfparse_transcript_transformer-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gtfparse_transcript_transformer-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32e6e326b67d8f63a1ec4b1a3f0ab284ed5371cf22fd9328018110d74b443a8e
MD5 b58a3fbafb8179f979ada00755472666
BLAKE2b-256 fef3f0a9f953ce8c8e7488a32db53243231d916e0bc75302e585f4d4e97b74b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page