Toolkit for processing genomic data files
Project description
TC PyTools
基因组数据处理工具集。
项目概述
本项目使用 uv 进行包管理和依赖管理,包含多个用于基因组数据处理的工具。
安装
前提条件
需要先安装 uv(快速的 Python 包管理器):
# Linux/macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# 或使用 pip
pip install uv
安装工具包
方式 1: 开发模式安装(推荐用于开发)
# 进入项目目录
cd tc-pytools-v2
# 同步依赖并安装包(可编辑模式)
uv sync
# 此时可以直接使用 uv run 运行命令
uv run rename-ngdc-genome-id --help
方式 2: 安装到用户环境(推荐用于日常使用)
# 进入项目目录
cd tc-pytools-v2
# 使用 uv pip 安装到当前 Python 环境
uv pip install -e .
# 或安装到系统(需要激活相应的虚拟环境)
# 激活虚拟环境后
pip install -e .
# 安装后可以直接使用命令
rename-ngdc-genome-id --help
方式 3: 从源码构建并安装
# 构建包
uv build
# 安装构建的包
uv pip install dist/tc_pytools-1.1.0-py3-none-any.whl
工具列表
| 工具名称 | 功能描述 | 主要用途 | 文档链接 |
|---|---|---|---|
tc-rename-genome-id |
重命名基因组染色体 ID | 支持 NGDC 基因组(自动提取 OriSeqID)和自定义映射两种模式,可同时处理 FASTA 和 GFF 文件 | 详细文档 |
tc-table2vcf |
表格转换为 VCF 格式 | 将包含 chrom、pos、refer、alt 四列的表格文件转换为标准 VCF 格式文件 | - |
💡 每个工具都有详细的使用文档,请点击文档链接查看具体用法和示例。
开发
快速命令
make help # 查看所有可用命令
make test # 运行测试
make ci # 运行完整 CI 检查
./ci.sh # 运行本地 CI 脚本
测试
# 运行所有测试
uv run pytest
# 运行测试并生成覆盖率报告
uv run pytest --cov
# 查看 HTML 覆盖率报告
uv run pytest --cov --cov-report=html
# 打开 htmlcov/index.html
代码质量
# 代码格式化
make format
# 代码检查
make lint
# 类型检查
make type-check
本地 CI
项目提供三种本地 CI 方式:
- CI 脚本:
./ci.sh - Make 命令:
make ci - Pre-commit:
uv run pre-commit run --all-files
详细使用说明请参考 QUICKREF.md
项目结构
tc-pytools-v1.1/
├── gtf/ # GTF 相关工具
│ ├── rename_ngdc_genome_id.py
│ ├── docs/ # 工具文档
│ └── tests/ # 单元测试
├── pyproject.toml # 项目配置
├── Makefile # Make 命令
├── ci.sh # CI 脚本
└── QUICKREF.md # 快速参考
文档
- INSTALL.md - 详细安装指南(推荐首先阅读)
- PUBLISH.md - PyPI 发布指南
- QUICKREF.md - 快速参考指南(中文)
- CHANGELOG.md - 版本更新日志
- SETUP_COMPLETE.md - 项目配置说明
- 各工具的详细文档位于对应的
docs/目录下
许可证
MIT
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
tc_pytools-1.1.5.tar.gz
(42.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tc_pytools-1.1.5.tar.gz.
File metadata
- Download URL: tc_pytools-1.1.5.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b75c0c24bc8d42a937ee34b4bd8c402c2d2adf3d4df2786ecd01be7b34e23d6
|
|
| MD5 |
1cb3c64c2985a0c91e20b028d6f4a850
|
|
| BLAKE2b-256 |
69f33dd01851008cb040c382a7a2a373689c41214aeeb213dc3daf12286aeb4c
|
File details
Details for the file tc_pytools-1.1.5-py3-none-any.whl.
File metadata
- Download URL: tc_pytools-1.1.5-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
813c14356566ee7704897ac4eadb4fdf2bf89c35cfabb8104809c5565c73de50
|
|
| MD5 |
8946e79e12110349691f0a7943e09614
|
|
| BLAKE2b-256 |
2a4adacfe70e13dcee6be83bb8a3b5ecfa29cb00de099462eac375c50fefb3b3
|