macでインフォマティクス

macでインフォマティクス

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

フォーマット変換 FASTA => BED

 

fasta.faiから作る。

samtools faidx input.fasta 
awk '{print $1 "\t0\t" $2}' input.fasta.fai > output.bed

 

またはpythonスクリプトを使う。

pip install pyfaidx 
faidx --transform bed input.fasta > output.bed

 

ヒトゲノムhg19ならこのようなbedができる。

user$ head hg19.bed 

chr1 0 249250621

chr2 0 243199373

chr3 0 198022430

chr4 0 191154276

chr5 0 180915260

chr6 0 171115067

chr7 0 159138663

chr8 0 146364022

chr9 0 141213431

chr10 0 135534747

 

 

 

引用

Shirley MD, Ma Z, Pedersen B, Wheelan S. Efficient "pythonic" access to FASTA files using pyfaidx. PeerJ PrePrints 3:e1196. 2015.

https://github.com/mdshw5/pyfaidx

 

Biostarスレッド

https://www.biostars.org/p/191052/