본문 바로가기
Bioinformatics

[Bedtools] fasta 파일에서 특정 영역 추출하기

by 코딩하는 미토콘드리아 bioinformatics 2022. 10. 4.
반응형

hg19 fasta 파일에서 chrosome X 와 chrosome Y PAR region sequence 정보만을 추출 해보겠습니다.

 

command

bedtools getfasta [OPTIONS] -fi <input FASTA> -bed <BED/GFF/VCF>


bedtools getfasta를 사용하면 쉽게 가능.

 

준비물

1. input fasta 파일

2. 영역이 지정된 bed 파일 (target bed)


fasta 파일은 hg19 reference genome sequences 가 담긴 fasta 파일이고
bed 파일은 chr, start position, end position, gene 으로 구성된 bed 파일 입니다.


아래 command 로 실행

결과파일 -> result.fasta 는 아래 처럼 bed 파일의 region 별로 fasta sequence 정보가 추출됩니다.

 

https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html

 

getfasta — bedtools 2.30.0 documentation

getfasta bedtools getfasta extracts sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file. Tip 1. The headers in the input FASTA file must exactly match the chromosome column in the BED file. 2. You can use the UNIX fold comma

bedtools.readthedocs.io

 

반응형