macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

GFF/GTFのfeatureをマージする feature_merge

 

タイトルの通りのツール。

 

インストール

macos10.14でcondaを使って導入した。

依存

#bioconda (link)
mamba install -c conda-forge -c bioconda -y feature_merge

#pip (pypi)
pip install feature-merge

feature_merge -h

$ feature_merge -h

Argument error( h ):  option -h not recognized

Usage: feature_merge [-i] [-e] [-s] [-x] [-v] [-t <number>]  [-m merge|append|error|skip|replace] [-f type[,type..]].. <input1> [<input_n>..]

Accepts GFF or GTF format.

-v Print version and exit

-f Comma seperated types of features to merge. Must be terms or accessions from the SOFA sequence ontology, "ALL", or "NONE". (Can be provided more than once to specify multiple merge groups)

-i Ignore strand, merge feature regardless of strand

-s Ignore sequence id, merge feature regardless of sequence id

-x Only merge features with identical coordinates

-t Threshold distance between features to merge 

-e Exclude component features from output

-m Merge strategy used to deal with id collisions between input files.

    merge: attributes of all features with the same primary key will be merged

    append: entry will have a unique, autoincremented primary key assigned to it (default)

    error: exception will be raised. This means you will have to edit the file yourself to fix the duplicated IDs

    skip: ignore duplicates, emitting a warning

    replace: keep last duplicate

 

実行方法

マージしたいGFF、またはGTFファイルを指定する。

#gff
feature_merge -m append input1.gff input2.gff input3.gff > out.gff3

#gtf and gff
feature_merge -m append input1.gtf input2.gff > out.gff3
  •  
  • -m    Merge strategy used to deal with id collisions between input files.

merge: attributes of all features with the same primary key will be merged
append: entry will have a unique, autoincremented primary key assigned to it (default)
error: exception will be raised. This means you will have to edit the file yourself to fix the duplicated IDs
skip: ignore duplicates, emitting a warning
replace: keep last duplicate

 

同一座標のフィーチャーのみをマージ

#gtf and gff
feature_merge -m append -x input1.gff input2.gff > out.gff3
  • -x   Only merge features with identical coordinates

 

コメント

マージするには適切な遺伝子構造をもったフィーチャーである必要があります。例えばstrigntie2のような方法でアライメントエビデンスを取り出して得たGTFなどは、遺伝子を予測したものではないため、適切なgene、CDSなどは持っていません。そのようなフィーチャーをマージすると、このツールに限らずエラーが発生する可能性が高いので、注意してください。

引用

https://github.com/brinkmanlab/feature_merge

 

関連