Skip to content

Posts BLAST #

Find similar titles

16회 업데이트 됨.

Edit
  • 최초 작성자
    Myunghee Jung
  • 최근 업데이트
    shlee

Structured data

Category
Software

BLAST #

생물정보학에 관심이 있어 처음 접하는 경우 가장 많이 보고 사용하는 Tool은 아마도 BLAST(Basic Local Alignment Search Tool)일 것이다. BLAST는 1990년 처음 소개된 후 Alignment를 중심으로 다양한 기능분석에 활용하는 프로그램으로 발전하였으며, 스마트시대에도 최고의 성능을 보인다. BLAST의 기본 사용법은 이 페이지를 참조한다. BLAST는 버젼 업데이트를 하면서 발전해갔는데, 2000년 중후반에 NGS 등의 대용량 데이터가 쏟아져 나오면서 기존의 BLAST의 속도로는 대용량 query나 검색 등을 하기에는 버거워졌다.

BLAST program #

BLAST를 진행하기 위해서 내가 넣어준 query 서열이 nucleotide sequence 인지 Protein sequence인지에 따라 BLAST program이 달라진다.

BLAST program은 총 다섯가지이며 nucleotide sequence가 input일 경우, blastn, tblastx, blastx를 이용하고, Protein sequence가 input일 경우, blastp, tblastn을 이용한다.

  • blastn : Nucleotide sequence 간의 비교
  • tblastx : Query nucleotide sequence와 nucleotide sequence DB를 6frame으로 변환 후 비교
  • blastx : Query nucleotide sequence를 6frame으로 변환 후 Protein sequence DB와 비교
  • blastp : Protein sequence 간의 비교
  • tblastn : Nucleotide sequence DB를 6frame으로 변환 후 query Protein sequence와 비교

BLAST+ 출현 #

기존의 BLAST가 갖고 있던 한계를 극복하기 위하여 2008년 BLAST+ 2.2.16 internal release (August 21, 2008.)를 시초로 BLAST+가 소개되었다. BLAST+는 기존 BLAST 사용자에게는 생소한 프로그램이나 BLAST의 업그레이드 버전이므로 기능적으로는 큰 차이가 없고 점점 늘어나는 데이터를 효율적으로 다루기 위해 좀 더 빨라졌고 성능이 개선되었다.

BLAST와 BLAST+ 비교 #

두 프로그램의 구성 프로그램은 유사하므로 BLAST+를 사용하기 위한 실제 사용자 위주의 명령어 비교가 좀 더 이해가 빠를 것이다.

명령어 비교 #

BLAST BLAST+ Description
blastall blastn, blastp, ... BLAST - 'blastall -p start command' / BLAST+ - 'start command'
-p n/a BLAST program: blastn, blastp, blastx, tblastn, ...
-i -query Input sequence file
-d -db BLAST database
-o -out Output file
-m -outfmt Output format: BLAST XML:7 TAB:8 / BLAST+ XML:5 TAB:7
-e -evalue Expectation value threshold
-a -num_threads Number of CPU cores to use
-F F -dust no / -seg no Disable low complexity filtering: DNA:dust AA:seg

BLAST+를 실행하는 명령어는 좀 더 직관적으로 표현되어 이해하기 쉽다. 또한, 기존에 잘 사용하는 output 모드인 tabular 이외에 좀 더 활용이 용이하도록 추가되었다.

BLAST
-m
0 = pairwise
1 = query-anchored showing identities
2 = query-anchored no identities
3 = flat query-anchored, show identities
4 = flat query-anchored, no identities
5 = query-anchored no identities and blunt ends
6 = flat query-anchored, no identities and blunt ends
7 = XML Blast output
8 = tabular
9 = tabular with comment lines
10 = ASN, text
11 = ASN, binary [Integer]
BLAST+
-outfmt
0 = pairwise
1 = query-anchored showing identities
2 = query-anchored no identities
3 = flat query-anchored, show identities
4 = flat query-anchored, no identities
5 = XML Blast output
6 = tabular
7 = tabular with comment lines
8 = Text ASN.1
9 = Binary ASN.1
10 = Comma-separated values
11 = BLAST archive format (ASN.1)
BLAST BLAST+ Description
formatdb makeblastdb
-i -in Input sequence file
-p T/F -dbtype prot/nucl Molecule type
-o T -parse_seqids Parse and index sequence IDs
-n -out Base name for output files
-mask_data masking process - masker programe / masking을 사용시 활용
-mask_file_sz 1GB / 2GB / ... - file size , size를 지정하지 않으면 1GB로 분할됨

makblastdb(formatdb) 생성의 예시

* BLAST+
makeblastdb -in <input.fasta> -input_type <fasta> -dbtype {nucl|prot} -parse_seqids -hash_index -mask_data {dustmasker/segmasker/windowmasker} -max_file_sz {1GB/2GB/...}

* BLAST
formatdb -i nr -n ../../newest_blast/blast/nr -p T -L zebrafish -F zebrafish.gi -t "My zebrafish database"

blast 실행 예시

* BLAST+
blastn -query <input.fasta> -db <blastdb or formatdb> -out <output.file> -evalue <e-value> -outfmt {0/1/..11} -num_threads <number thread>

* BLAST
blastall -p blastn -d zebrafish -i MYQUERY -o MYOUTPUT

BLAST 실행 팁 #

BLAST 결과 파일 포맷 변환 #

BLAST+에서만 지원되는 것으로 확인되는 blast_formatter라는 프로그램을 이용하면 하나의 결과 파일을 다양한 포맷 (위의 output 모드 참고)으로 변환이 가능하다. 단 주의할 점은 처음 BLAST (BLAST+) 수행 시 output 모드를 asn 포맷으로 지정해 주어야 한다는 점이다 (-m 11).

blast_formatter의 예시는 다음과 같다. -outfmt에서 입력받는 값은 BLAST+의 -m (-outfmt)와 동일하게 작용한다.

blast_formatter -archive [output].asn -outfmt 6 -out [output].tabular

OmicsBox 분석을 위한 BLAST output 생성 #

OmicsBox (구 Blast2GO)분석을 위해서는 Blast+ v2.2.31 이상에서 지원하는 XML2 포맷으로 결과를 출력하여야 한다. XML2 format은 다음과 같이 2개의 출력 포맷으로 결과를 받을 수 있다.

14 = Multiple-file BLAST XML2,
16 = Single-file BLAST XML2,

이때 outfmt=14로 주면 수많은 xml2 파일이 생성되므로 outfmt=16으로 분석을 수행하는 편이 더욱 좋다.

BLAST 결과 custom format 출력 #

BLAST 실행 시 -outfmt 파라미터를 적용하면 결과 파일의 포맷을 지정해줄 수 있다. 이때 6, 7, 10 지정 시 결과 파일의 컬럼을 원하는 대로 출력할 수 있다.

    qseqid means Query Seq-id
       qgi means Query GI
      qacc means Query accesion
   qaccver means Query accesion.version
      qlen means Query sequence length
    sseqid means Subject Seq-id
 sallseqid means All subject Seq-id(s), separated by a ';'
       sgi means Subject GI
    sallgi means All subject GIs
      sacc means Subject accession
   saccver means Subject accession.version
   sallacc means All subject accessions
      slen means Subject sequence length
    qstart means Start of alignment in query
      qend means End of alignment in query
    sstart means Start of alignment in subject
      send means End of alignment in subject
      qseq means Aligned part of query sequence
      sseq means Aligned part of subject sequence
    evalue means Expect value
  bitscore means Bit score
     score means Raw score
    length means Alignment length
    pident means Percentage of identical matches
    nident means Number of identical matches
  mismatch means Number of mismatches
  positive means Number of positive-scoring matches
   gapopen means Number of gap openings
      gaps means Total number of gaps
      ppos means Percentage of positive-scoring matches
    frames means Query and subject frames separated by a '/'
    qframe means Query frame
    sframe means Subject frame
      btop means Blast traceback operations (BTOP)
   staxids means unique Subject Taxonomy ID(s), separated by a ';'
         (in numerical order)
 sscinames means unique Subject Scientific Name(s), separated by a ';'
 scomnames means unique Subject Common Name(s), separated by a ';'
sblastnames means unique Subject Blast Name(s), separated by a ';'
         (in alphabetical order)
sskingdoms means unique Subject Super Kingdom(s), separated by a ';'
         (in alphabetical order)
    stitle means Subject Title
salltitles means All Subject Title(s), separated by a '<>'
   sstrand means Subject Strand
     qcovs means Query Coverage Per Subject
   qcovhsp means Query Coverage Per HSP

Default는 'qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore'이고, 간혹 e-value cutoff가 불충분하여 query의 alignment coverage로 추가 필터링을 수행할 때가 있는데 이때 다음과 같은 커맨드를 활용하면 query length를 같이 출력할 수 있어서 편리하다.

blastp -max_target_seqs 20 -num_threads 20 -db /database/nr -outfmt '6 qseqid sseqid pident length mismatch gapopen qlen qstart qend slen sstart send evalue bitscore staxids stitle' -evalue 1e-3 -query query.fa -out query_to_nr.blast

6번 table 형태의 text 파일로 BLAST 결과를 출력하는데 이때 컬럼은 Query Seq-id, Subject Seq-id, Percentage of identical matches, Alignment length, Number of mismatches, Number of gap openings, Query sequence length, Start of alignment in query, End of alignment in query, Subject sequence length, Start of alignment in subject, End of alignment in subject, Expect value, Bit score, unique Subject Taxonomy ID(s), Subject Title 순으로 형성된다.

qlen, seln을 추가함으로써 결과 파일에서 query와 subject의 길이를 바로 파악할 수 있고 별도로 서열의 길이를 검색할 필요 없이 query와 subject 각각의 alignment coverage를 계산할 수 있다.

참고문헌 및 사이트 #

BLAST+ 매뉴얼

내부 링크 #

Incoming Links #

Related Articles #

Related Etcs #

Related Bioinformaticses #

Suggested Pages #

Other Posts #

0.0.1_20231010_1_v71