macでインフォマティクス

macでインフォマティクス

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

FASTQ、BED、BAMを操作するNGSUtilsその4 gtfutils

 

4回目はgtfを操作するgtfutilsを紹介する。

 

インストール

公式ページ

NGSUtils 

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.