macでインフォマティクス

macでインフォマティクス

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

ゲノムの指定した領域をNでマスクする

 

bedtoolsを使う。

 

Document

 

bedtoolsのインストール

本体 Github

 

#bioconda(link)
condaw install -c bioconda -y bedtools

bedtools maskfasta

$ bedtools maskfasta

 

Tool:    bedtools maskfasta (aka maskFastaFromBed)

Version: v2.29.0

Summary: Mask a fasta file based on feature coordinates.

 

Usage:   bedtools maskfasta [OPTIONS] -fi <fasta> -fo <fasta> -bed <bed/gff/vcf>

 

Options:

-fi Input FASTA file

-bed BED/GFF/VCF file of ranges to mask in -fi

-fo Output FASTA file

-soft Enforce "soft" masking.

Mask with lower-case bases, instead of masking with Ns.

-mc Replace masking character.

Use another character, instead of masking with Ns.

-fullHeader Use full fasta header.

By default, only the word before the first space or tab

is used.

 

 

実行方法

入力の FASTAとマスクしたい領域のBED/GFF/VCFを指定して実行する。

bedtools maskfasta -fi input.fa -fo mask.fa -bed regions.bed

出力

f:id:kazumaxneo:20200114200153p:plain

 

 

ソフトマスク

bedtools maskfasta -fi input.fa -fo mask.fa -bed regions.bed -soft

出力

f:id:kazumaxneo:20200114200655p:plain

 

引用

BEDTools: a flexible suite of utilities for comparing genomic features.

Quinlan AR1, Hall IM.

Bioinformatics. 2010 Mar 15;26(6):841-2. 

https://www.ncbi.nlm.nih.gov/pubmed/20110278

 

関連