Skip to main content

rna-toolkit

PyPI version License: MIT Python

RNA FASTA 工具箱:解析、统计、k-mer、可视化、报告。

功能

  • FASTA / .fa.gz 解析,支持多行、空行、大小写、T/U 转换
  • 长度统计:条数、总长、最短、最长、平均、中位数、N50
  • 碱基组成:A / C / G / U / N / other,含 GC 含量
  • k-mer 统计:k=1~5,输出 top N
  • 可视化:长度分布、碱基比例、top k-mer
  • 报告:summary.json、length_stats.csv、kmer_topN.csv、report.md

安装

从 PyPI 安装(推荐)

pip install rna-toolkit

从源码安装(开发用)

git clone https://github.com/zzc-npc/biopython.git
cd biopython
conda create -n rna_project python=3.12 -y
conda activate rna_project
pip install -e .
pip install matplotlib pytest

使用

一条命令跑完统计、k-mer、图、报告:

rna-toolkit stats --input data/test/test.fa --out results/ --kmer 2 --top-n 10

只看帮助:

rna-toolkit --help
rna-toolkit stats --help
rna-toolkit kmer --help

输出

results/
├── summary.json          # 基本统计
├── length_stats.csv      # 每条序列的 header、length、gc_content
├── kmer_top10.csv        # top 10 k-mer
├── report.md             # Markdown 报告
└── figures/
    ├── length_hist.png
    ├── base_composition.png
    └── kmer_top.png

项目结构

biopython/
├── pyproject.toml
├── README.md
├── .gitignore
├── data/
│   ├── raw/              # 原始数据,只读
│   └── test/             # 小测试文件
├── results/              # 输出目录
├── src/
│   └── rna_toolkit/
│       ├── __init__.py
│       ├── __main__.py   # python -m rna_toolkit 入口
│       ├── cli.py        # argparse 主逻辑
│       ├── fasta.py      # FASTA 解析
│       ├── kmer.py       # k-mer 滑窗与计数
│       ├── plots.py      # matplotlib 画图
│       ├── report.py     # report.md 生成
│       └── commands/     # CLI 子命令
│           ├── __init__.py
│           ├── stats.py
│           └── kmer.py
└── tests/
    ├── test_fasta.py
    ├── test_stats.py
    └── test_kmer.py

测试

pytest -v

数据来源

依赖

  • Python >= 3.10
  • matplotlib

开发依赖

  • pytest

许可

MIT License,详见 LICENSE。

Metadata

Release files for rna-toolkit 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rna-toolkit 0.1.1
File Size Uploaded
rna_toolkit-0.1.1.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rna-toolkit 0.1.1
File Interpreter ABI Platform
rna_toolkit-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / rna_toolkit-0.1.1.tar.gz

Download URL rna_toolkit-0.1.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6a4e4fe4151dc7892b67246abe5f8cc2bbab10d490b8c754a36c55fc8533cc14
BLAKE2b-256 checksum
How to use checksums
96d49eb3799f74daeeff6c1632f02b3cbb418f88355009e60ae2a8cb0efa3aac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.9

Release files / rna_toolkit-0.1.1-py3-none-any.whl

Download URL rna_toolkit-0.1.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e047382223b48aefec4a1407b239f1ce3ed22b12a697825ddff7af9baa2c50ff
BLAKE2b-256 checksum
How to use checksums
de35d005af7ad94f789506c8ad7b19bdd0bd0692fdb790c66eba466001768519
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page