4回目はgtfを操作するgtfutilsを紹介する。
インストール
公式ページ
git clone git://github.com/ngsutils/ngsutils.git
cd ngsutils/
make #依存がインストールされる(詳細はwebマニュアル参照)
#conda
mamba create -n ngsutils python=2.7 -y
conda activate ngsutils
mamba install -c bioconda ngsutils -y
$ gtfutils
Usage: gtfutils COMMAND
Commands
General
add_isoform - Appends isoform annotation from UCSC isoforms file
add_reflink - Appends isoform/name annotation from RefSeq/refLink
add_xref - Appends name annotation from UCSC Xref file
annotate - Annotates genomic positions based on a GTF model
filter - Filter annotations from a GTF file
genesize - Extract genomic/transcript sizes for genes
junctions - Build a junction library from FASTA and GTF model
query - Query a GTF file by coordinates
Conversion
fromgff - Convert a GFF to a GTF file
tobed - Convert a GFF/GTF file to BED format
Run 'gtfutils help CMD' for more information about a specific command
ngsutils 0.5.9-a7f08f5
パスを通しておく。
ラン
filter(リンク)条件でフィルタリング
#UCSCスタイル(1、2)からNCBIスタイル(chr1、chr2)に変更
gtfutils filter -to-ucsc input.gtf > output.gtf
-chr str Remove annotations from chromosomes with 'str' in the name
-to-ucsc Rename Ensembl-style chromosome names (1, 2, etc) to
UCSC/NCBI-style names (chr1, chr2, etc.)
genesize(リンク)サイズを抽出
gtfutils genesize input.gtf
query(リンク)指定領域内のgeneを抽出
#chr1の10000-20000に存在する遺伝子
gtfutils query input.gtf chr1:10000-20000
remove_dup(リンク)重複するアノテーションを別名に修正
gtfutils remove_dup input.gtf
fromgff(リンク)GFFをGTFに変換
gtfutils fromgff input.gff > output.gtf
tobed(リンク)GTF/GFFをBEDに変換
gtfutils robed input.gtf > output.gtf
tobed(リンク)GTF/GFFをBEDに変換
gtfutils robed input.gtf > output.gtf
add_xref(リンク)UCSCのkgXref tableを使いGTFにgene_nameを追加する
gtfutils add_xref input.gtf kgXref.txt
kgXref tableの5カラム目が使われる。
add_reflink(リンク)UCSCのrefLink tableを使いGTFにgene_nameとisoform annotationsを追加する
gtfutils add_reflink input.gtf reflink.txt
annotate(リンク)指定のテキストファイルに従ってアノテーションを追加する
junctions(リンク)splicing junctionを繋いだ配列を作る
引用
NGSUtils: a software suite for analyzing and manipulating next-generation sequencing datasets
Marcus R. Breese and Yunlong Liu
Bioinformatics. 2013 Feb 15; 29(4): 494–496.