Skip to main content

Chromatogram File Utils

Project description

Readthedocs Build Status Pypi Releases Downloads

Chromatogram File Utils

For Sanger sequencing data visualizing, alignment, mutation calling, and trimming etc.

Demo

plot chromatogram with mutation

command to generate the demo above

cfutils mut --query ./data/B5-M13R_B07.ab1 --subject ./data/ref.fa --outdir ./data/ --plot

How to use?

  • You can have mutation detection and visualization in one step using the command line.
cfutils mut --help
  • You can also integrate the result matplotlib figures and use it as a python module.

An example:

import matplotlib.pyplot as plt
import numpy as np

from cfutils.parser import parse_abi
from cfutils.show import plot_chromatograph

seq = parse_abi("./data/B5-M13R_B07.ab1")
peaks = seq.annotations["peak positions"][100:131]

fig, axes = plt.subplots(2, 1, figsize=(12, 6), sharex=True)
plot_chromatograph(
    seq,
    region=(100, 130),
    ax=axes[0],
    show_bases=True,
    show_positions=True,
    color_map=dict(zip("ATGC", ["C0", "C2", "C1", "C4"])),
)
axes[1].bar(peaks, np.random.randn(len(peaks)), color="0.66")
plt.show()

plot chromatogram in_matplotlib

How to install?

form pypi

(use this way ONLY, if you don't know what's going on)

pip install --user cfutils

manipulate the source code

  • clone from github
git clone git@github.com:y9c/cfutils.git
  • install the dependence
make init
  • do unittest
make test

ChangeLog

  • Reverse completement the chromatogram file. (Inspired by Snapgene)
  • build as python package for pypi
  • fix bug that highlighting wrong base
  • replace blastn with buildin python aligner

TODO

  • call mutation by alignment and plot Chromatogram graphic

  • add a doc

  • change xaxis by peak location

  • fix bug that chromatogram switch pos after trim

  • wrap as a cli app

  • return quality score in output

  • fix issue that selected base is not in the middle

  • fix plot_chromatograph rendering bug

  • add projection feature to make align and assemble possible

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

cfutils-0.0.0.dev59.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

cfutils-0.0.0.dev59-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file cfutils-0.0.0.dev59.tar.gz.

File metadata

  • Download URL: cfutils-0.0.0.dev59.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.13 Darwin/22.6.0

File hashes

Hashes for cfutils-0.0.0.dev59.tar.gz
Algorithm Hash digest
SHA256 eb7d4fefcacfe0d66626df2417d88b50eef01d85da0f340d1704054ce791f14a
MD5 c61a6968f93566d7c9d5c7713fce2712
BLAKE2b-256 03312a10e6007e9c006415b7c4c672f7a87c7ad4e3f244df95d54ce3b2746ee9

See more details on using hashes here.

File details

Details for the file cfutils-0.0.0.dev59-py3-none-any.whl.

File metadata

  • Download URL: cfutils-0.0.0.dev59-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.13 Darwin/22.6.0

File hashes

Hashes for cfutils-0.0.0.dev59-py3-none-any.whl
Algorithm Hash digest
SHA256 199f8b6bcbf8ade3edc1460d3fe437e40dd1c5cf9a7baaa8d64b2d03c37d1719
MD5 409dd0893b39d29a005e513beadfb0cd
BLAKE2b-256 7843e070f17064aaf49c5906139af83dde7f151c16db5104389ccbedcffd344e

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