ゲノムアノテーションは、多様な調節要素や転写バリアントの発見により、ますます包括的になりつつある。しかし、このアノテーション精度の向上は、特に大規模ゲノムやパンゲノムを横断する効率的なクエリに対して重大な課題をもたらす。既存のツールは、大規模ゲノムアノテーションファイルの処理、特に領域ベースのクエリや階層モデル抽出において、しばしば性能ボトルネックを示す。本稿では、超高速かつスケーラブルなゲノムアノテーションアクセスを実現するRustベースのツールキットGFFxを提案する。GFFxは、ビニング戦略に着想を得たコンパクトでモデルを意識したインデックスシステムを導入し、Rustの実行速度、メモリ安全性、マルチスレッド処理の強みを活用する。既存ツールと比較し、実行時間とスケーラビリティを大幅に向上させた特徴ベースおよび領域ベースの抽出をサポートする。Cargo経由で配布されるGFFxは、クロスプラットフォーム対応のコマンドラインインターフェースとクリーンなAPIを備えた再利用可能なライブラリを提供し、カスタムパイプラインへのシームレスな統合を可能にする。ベンチマーク結果から、GFFxが大幅な高速化を実現し、ゲノムアノテーションワークフロー向けの実用的かつ拡張性のあるソリューションとなることが実証された。
インストール
cargoで導入した(最新のRustをインストールしておく必要がある)。
依存
- Requires Rust 1.70 or later. You can install or update Rust using rustup.
#cargo
cargo install gffx
#from source
git clone https://github.com/Baohua-Chen/GFFx.git
cd GFFx
cargo build --release
# Optionally copy the binary
cp target/release/gffx /your/path
> gffx
$ gffx
GFFx: A ultra-fast feature extractor for GFF files
Version: 0.3.2
Usage: gffx <COMMAND>
Commands:
index Build index for GFF file
intersect Extract models by a region or regions from a BED file
extract Extract models by feature IDs
search Search features by attribute values and extract their full models.
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
> gffx index -h
Build index for GFF file
Usage: gffx index [OPTIONS] --input <INPUT>
Options:
-i, --input <INPUT>
-a, --attribute <ATTRIBUTE> [default: gene_name]
-v, --verbose
-h, --help Print help (see more with '--help')
-V, --version Print version
> gffx intersect -h
Extract models by a region or regions from a BED file
Usage: gffx intersect [OPTIONS] --input <FILE> <--region <REGION>|--bed <BED>>
Options:
-i, --input <FILE> Input GFF file path
-o, --output <FILE> Output file (stdout if not provided)
-F, --full-model Return the entire gene model for each match (full-model mode); default: only the matched feature (feature-only mode)
-T, --types <TYPES> Comma-separated feature types to retain (e.g. exon,gene); only effective in feature-only mode
-t, --threads <NUM> Number of threads for parallel processing [default: 12]
-v, --verbose Enable verbose output
-r, --region <REGION> Single region in format "chr:start-end"
-b, --bed <BED> BED file containing regions
-c, --contained Only return features fully contained within regions
-C, --contains-region Only return features that fully contain the regions
-O, --overlap Return any overlapping features (default)
-I, --invert Invert the selection (exclude matching features)
-h, --help Print help (see more with '--help')
-V, --version Print version
> gffx extract -h
Extract models by feature IDs
Usage: gffx extract [OPTIONS] --input <FILE> <--feature-file <FEATURE_FILE>|--feature-id <FEATURE_ID>>
Options:
-i, --input <FILE> Input GFF file path
-o, --output <FILE> Output file (stdout if not provided)
-F, --full-model Return the entire gene model for each match (full-model mode); default: only the matched feature (feature-only mode)
-T, --types <TYPES> Comma-separated feature types to retain (e.g. exon,gene); only effective in feature-only mode
-t, --threads <NUM> Number of threads for parallel processing [default: 12]
-v, --verbose Enable verbose output
-e, --feature-id <FEATURE_ID>
-E, --feature-file <FEATURE_FILE>
-h, --help Print help (see more with '--help')
-V, --version Print version
> gffx search -h
Search features by attribute values and extract their full models.
Usage: gffx search [OPTIONS] --input <FILE> <--attr-list <ATTR_LIST>|--attr <ATTR>>
Options:
-i, --input <FILE> Input GFF file path
-o, --output <FILE> Output file (stdout if not provided)
-F, --full-model Return the entire gene model for each match (full-model mode); default: only the matched feature (feature-only mode)
-T, --types <TYPES> Comma-separated feature types to retain (e.g. exon,gene); only effective in feature-only mode
-t, --threads <NUM> Number of threads for parallel processing [default: 12]
-v, --verbose Enable verbose output
-A, --attr-list <ATTR_LIST> Attribute list file (one per line)
-a, --attr <ATTR> Single attribute value to search
-r, --regex Enable regex mode for attribute matching
-h, --help Print help
-V, --version Print version
実行方法
1、index
GFFのindexを作成する。他のサブコマンド実行時に使用する。-aで検索に使う属性を指定する。
gffx index -i input.gff -a gene_name
- -i <INPUT>
- -a ATTRIBUTE [default: gene_name]
出力例
indexはGFFファイルのパスにあれば自動で認識する。詳細は論文の"Figure 1. Architecture of the indexing system and subcommand interactions in GFFx"などを参照。
2、intersect
chr1 の 10,000–20,000 bp と重なる全フィーチャを抽出する。
gffx intersect --region chr1:10000-20000 -i genes.gff -o out.gff -F
- -i Input GFF file path
- -o Output file (stdout if not provided)
- -F Return the entire gene model for each match (full-model mode); default: only the matched feature (feature-only mode)
- -r Single region in format "chr:start-end"
3、extract
genes.txt に書かれた遺伝子ID の全フィーチャを抽出する。
gffx extract -E genes.txt -i genes.gff -o subset.gff -F
- -E <FEATURE_FILE>
- -t Number of threads for parallel processing [default: 12]
4、search
遺伝子名で検索する。遺伝子名にTP53が含まれるフィーチャーを検索して返す。
gffx search -a TP53 -i genes.gff -o tp53_model.gff
引用
GFFx: A Rust-based suite of utilities for ultra-fast genomic feature extraction
Baohua Chen, Dongya Wu, Guojie Zhang
bioRxiv, Posted August 12, 2025.
関連
コメント
論文図2、3に性能評価結果が提示されています。特にラージゲノムでランタイムの大幅な短縮が期待できると思います。