2回目はbedを操作するbedutilsを紹介する。
インストール
公式ページ
git clone git://github.com/ngsutils/ngsutils.git
cd ngsutils/
make #依存がインストールされる(詳細はwebマニュアル参照)
$ ./bedutils
Usage: bedutils COMMAND
Commands
General
clean - Cleans a BED file (score should be integers)
extend - Extends BED regions (3')
overlap - Find overlapping BED regions from a query and target file
reduce - Merges overlapping BED regions
refcount - Given a number of BED files, calculate the number of samples that overlap regions in a reference BED file
sizes - Extract the sizes of BED regions
sort - Sorts a BED file (in place)
stats - Calculates simple stats for a BED file
subtract - Subtracts one set of BED regions from another
Conversion
annotate - Annotate BED files by adding / altering columns
frombasecall - Converts a file in basecall format to BED3 format
fromprimers - Converts a list of PCR primer pairs to BED regions
fromvcf - Converts a file in VCF format to BED6
tobed3 - Removes extra columns from a BED (or BED compatible) file
tobed6 - Removes extra columns from a BED (or BED compatible) file
tobedgraph - BED to BedGraph
tofasta - Extract BED regions from a reference FASTA file
Misc
cleanbg - Cleans up a bedgraph file
Run 'bedutils help CMD' for more information about a specific command
ngsutils 0.5.9-a7f08f5
パスを通しておく。
ラン
clean(リンク)ポジションを整数に修復する。
bamutils clean input.bed > output.bed
extend(リンク)ポジションを指定数変更する。
#5'側を100bp、3'側を100bp伸ばす
bamutils extend -5 100 -3 100 input.bed > output.bed
nearest(リンク)リファレンスの最も近い位置のアノテーションを取ってくる
bamutils nearest input.bed reference.bed
-
-max The maximal distance to look for a nearest region (default: 100K)
-
-match Only use regions in the reference that contain the name from the query file.
sizes(リンク)領域のサイズを調べる。
bamutils sizes input.bed > output
sort(リンク)ポジションソートする。
bamutils sort input.bed output.bed
stats(リンク)statistics
bamutils stats input.bed
tobed3(リンク)3カラム形式のbedに変換。
bamutils tobed3 input.bed > output.bed
tobed6(リンク)6カラム形式のbedに変換。
bamutils tobed6 input.bed > output.bed
bamutils tofasta input.bed ref.fasta > output.fasta
overlap(リンク)オーバーラップする領域を探す
reduce(リンク)オーバーラップする領域を減らす。
refcount(リンク)オーバーラップする領域数を数える。
subtract(リンク)2つのbedを比較してオーバーラップする領域を消す。
annotate(リンク)アノテーションをつけてBED3からBED6に変換。
frombasecall(リンク)basecallフォーマットからBED3に変換。
fromprimers(リンク)primerペアからBEDで領域を作成。
tobedgraph(リンク)オーバーラップがあるbedからbedgraphを作成。
cleanbg(リンク)bedgraphを修復。
bedのオーバーラップを抽出したりするならbedtoolsを使ってください。
引用
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.