[![Readthedocs](https://readthedocs.org/projects/cfutils/badge/?version=latest)](https://cfutils.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://img.shields.io/travis/y9c/cfutils.svg)](https://travis-ci.org/y9c/cfutils)
[![Pypi Releases](https://img.shields.io/pypi/v/cfutils.svg)](https://pypi.python.org/pypi/cfutils)
[![Downloads](https://static.pepy.tech/badge/cfutils)](https://pepy.tech/project/cfutils)
**Chromatogram File Utils**
For Sanger sequencing data visualizing, alignment, mutation calling, and trimming etc.
## Demo
![plot chromatogram with mutation](https://raw.githubusercontent.com/y9c/cfutils/master/data/plot.png)
> command to generate the demo above
```bash
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.
```bash
cfutils mut --help
```
- You can also integrate the result matplotlib figures and use it as a python module.
An example:
```python
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](https://raw.githubusercontent.com/y9c/cfutils/master/data/matplotlib_example.png)
## How to install?
### form pypi
_(use this way ONLY, if you don't know what's going on)_
```bash
pip install --user cfutils
```
### manipulate the source code
- clone from github
```bash
git clone git@github.com:y9c/cfutils.git
```
- install the dependence
```bash
make init
```
- do unittest
```bash
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
- [x] change xaxis by peak location
- [ ] fix bug that chromatogram switch pos after trim
- [x] 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
Raw data
{
"_id": null,
"home_page": "https://github.com/yech1990/cfutils",
"name": "cfutils",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "DNA,mutation,chromatogram,biology",
"author": "Ye Chang",
"author_email": "yech1990@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/03/31/2a10e6007e9c006415b7c4c672f7a87c7ad4e3f244df95d54ce3b2746ee9/cfutils-0.0.0.dev59.tar.gz",
"platform": null,
"description": "[![Readthedocs](https://readthedocs.org/projects/cfutils/badge/?version=latest)](https://cfutils.readthedocs.io/en/latest/?badge=latest)\n[![Build Status](https://img.shields.io/travis/y9c/cfutils.svg)](https://travis-ci.org/y9c/cfutils)\n[![Pypi Releases](https://img.shields.io/pypi/v/cfutils.svg)](https://pypi.python.org/pypi/cfutils)\n[![Downloads](https://static.pepy.tech/badge/cfutils)](https://pepy.tech/project/cfutils)\n\n**Chromatogram File Utils**\n\nFor Sanger sequencing data visualizing, alignment, mutation calling, and trimming etc.\n\n## Demo\n\n![plot chromatogram with mutation](https://raw.githubusercontent.com/y9c/cfutils/master/data/plot.png)\n\n> command to generate the demo above\n\n```bash\ncfutils mut --query ./data/B5-M13R_B07.ab1 --subject ./data/ref.fa --outdir ./data/ --plot\n```\n\n## How to use?\n\n- You can have mutation detection and visualization in one step using the command line.\n\n```bash\ncfutils mut --help\n```\n\n- You can also integrate the result matplotlib figures and use it as a python module.\n\nAn example:\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom cfutils.parser import parse_abi\nfrom cfutils.show import plot_chromatograph\n\nseq = parse_abi(\"./data/B5-M13R_B07.ab1\")\npeaks = seq.annotations[\"peak positions\"][100:131]\n\nfig, axes = plt.subplots(2, 1, figsize=(12, 6), sharex=True)\nplot_chromatograph(\n seq,\n region=(100, 130),\n ax=axes[0],\n show_bases=True,\n show_positions=True,\n color_map=dict(zip(\"ATGC\", [\"C0\", \"C2\", \"C1\", \"C4\"])),\n)\naxes[1].bar(peaks, np.random.randn(len(peaks)), color=\"0.66\")\nplt.show()\n```\n\n![plot chromatogram in_matplotlib](https://raw.githubusercontent.com/y9c/cfutils/master/data/matplotlib_example.png)\n\n## How to install?\n\n### form pypi\n\n_(use this way ONLY, if you don't know what's going on)_\n\n```bash\npip install --user cfutils\n```\n\n### manipulate the source code\n\n- clone from github\n\n```bash\ngit clone git@github.com:y9c/cfutils.git\n```\n\n- install the dependence\n\n```bash\nmake init\n```\n\n- do unittest\n\n```bash\nmake test\n```\n\n## ChangeLog\n\n- Reverse completement the chromatogram file. (Inspired by Snapgene)\n- build as python package for pypi\n- fix bug that highlighting wrong base\n- replace blastn with buildin python aligner\n\n## TODO\n\n- [ ] call mutation by alignment and plot Chromatogram graphic\n- [ ] add a doc\n- [x] change xaxis by peak location\n- [ ] fix bug that chromatogram switch pos after trim\n- [x] wrap as a cli app\n- [ ] return quality score in output\n- [ ] fix issue that selected base is not in the middle\n- [ ] fix plot_chromatograph rendering bug\n\n- [ ] add projection feature to make align and assemble possible\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Chromatogram File Utils",
"version": "0.0.0.dev59",
"project_urls": {
"Documentation": "https://cf.readthedocs.io/",
"Homepage": "https://github.com/yech1990/cfutils",
"Repository": "https://github.com/yech1990/cfutils"
},
"split_keywords": [
"dna",
"mutation",
"chromatogram",
"biology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7843e070f17064aaf49c5906139af83dde7f151c16db5104389ccbedcffd344e",
"md5": "409dd0893b39d29a005e513beadfb0cd",
"sha256": "199f8b6bcbf8ade3edc1460d3fe437e40dd1c5cf9a7baaa8d64b2d03c37d1719"
},
"downloads": -1,
"filename": "cfutils-0.0.0.dev59-py3-none-any.whl",
"has_sig": false,
"md5_digest": "409dd0893b39d29a005e513beadfb0cd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 15468,
"upload_time": "2023-09-21T21:50:24",
"upload_time_iso_8601": "2023-09-21T21:50:24.839546Z",
"url": "https://files.pythonhosted.org/packages/78/43/e070f17064aaf49c5906139af83dde7f151c16db5104389ccbedcffd344e/cfutils-0.0.0.dev59-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "03312a10e6007e9c006415b7c4c672f7a87c7ad4e3f244df95d54ce3b2746ee9",
"md5": "c61a6968f93566d7c9d5c7713fce2712",
"sha256": "eb7d4fefcacfe0d66626df2417d88b50eef01d85da0f340d1704054ce791f14a"
},
"downloads": -1,
"filename": "cfutils-0.0.0.dev59.tar.gz",
"has_sig": false,
"md5_digest": "c61a6968f93566d7c9d5c7713fce2712",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 14081,
"upload_time": "2023-09-21T21:50:27",
"upload_time_iso_8601": "2023-09-21T21:50:27.142359Z",
"url": "https://files.pythonhosted.org/packages/03/31/2a10e6007e9c006415b7c4c672f7a87c7ad4e3f244df95d54ce3b2746ee9/cfutils-0.0.0.dev59.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-21 21:50:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yech1990",
"github_project": "cfutils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cfutils"
}