Coder Social home page Coder Social logo

gene_model_plot's Introduction

gene_model_plot

gene_model_plot is a Python package designed to visualize gene models from GTF files and variants from VCF files. The package allows for easy extraction and plotting of gene features such as exons, UTRs, start/stop codons, and variants. Utilizes matplotlib, pysam, and gffutils.

Features

  • Create or load a gene feature database from GTF files.
  • Extract and plot gene features including exons, UTRs, start codons, and stop codons.
  • Extract and plot variants from VCF files.
  • Support for visualizing multiple VCF files.
  • Generate plots as images or base64-encoded strings.

Installation

To install gene_model_plot, pip install it from this repo:

pip install git+https://github.com/rnabioco/gene_model_plot.git

Usage

Here is an example of how to use GeneModelPlot to visualize a gene model:

from gene_model_plot.gene_model import GeneModel

# initialize the GeneModel object with the GTF file 
# to create the gene model object
gmo = GeneModel("gencode.v43.annotation.gtf")

# plot the gene model
gmo.plot("ENST00000339475.10")

output

# Alternatively, save the plot as a PNG file
gene_model.plot(gene_id, return_png=True)

# Or get the plot as a base64-encoded string
base64_image = gene_model.plot(gene_id, return_base64=True)

# load vcf tracks with a vcf file or a directory of vcf_files
gmo = GeneModel("gencode.v43.annotation.gtf", "/vcfs/modifications.vcf")

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

gene_model_plot's People

Contributors

mlkaufman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.