CSGChang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # BLAST+ 的安裝與基礎使用 ###### tags: `ubuntu`,`學習筆記`,`bioinformatics` 許多需要做物種序列比對的人都用過 NCBI 的 [BLAST(Basic Local Alignment Search Tool)網頁服務](https://blast.ncbi.nlm.nih.gov/Blast.cgi),其實他們也有推出單機版的一系列程式 [BLAST+ executables](https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=Download),最新版可以從 https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ 取得。 在 Ubuntu 中的安裝方法: ```bash= wget https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.13.0+-x64-linux.tar.gz tar -zxvf ncbi-blast-2.13.0+-x64-linux.tar.gz sp -r ./ncbi-blast-2.13.0+ ~/ export PATH=~/ncbi-blast-2.13.0+/bin:$PATH #檢查是否安裝成功 blastn -version ``` 最後要編輯 `/etc/profile` 加入 `export PATH=${PATH}:/home/USERNAME/ncbi-blast-2.13.0+/bin` 如果下載的是 `.rpm` 檔,用 `rpm -ivh` 指令安裝即可。 裝好之後,就可以在電腦用指令來做序列比對了。 這是平常在比對序列的時候,自己常用的指令: ```bash! $ blastn -remote -db nt -query filename.fasta -outfmt "6 qseqid qgi evalue bitscore pident staxids sscinames" -out outputfilename -perc_identity 90 -evalue 1e-5 -max_hsps 1 ``` 最後的輸出會是一個 tab 分隔的文字檔(tsv)。 裡面幾個常用參數解釋如下: * `-remote` 遠端模式,直接上 NCBI GeneBank 的資料庫比對,而不使用本機儲存的資料庫。 * `-db` database,這邊選的是 `nt`,也就是 nucleotide 資料庫。 * `-query` 與 `-out` 分別指定輸入與輸出的檔名。 * `-outfmt` 指定輸出的樣式,選擇 6 可以自由指定所需要的參數,參數與其他的樣式詳見後述。 * `perc_identity` 指定比對的結果,只回傳大於指定相似度的結果。 * `evalue` 比對的期望值(越小越好),只回傳小於指定期望值的結果。預設值為 10,一般會設定 1e-5,即 $10^{-5}$。 * `max_hsps` 指定如果一條 query 序列和目標序列有多處對應,可以回傳多少結果。這個指令在 query 序列比較短或目標序列長的情況下可能使用,會依照 evalue 的排序來輸出指定數量的結果。 ### 輸出結果的格式與參數 依據 NCBI 的[說明文件](https://www.ncbi.nlm.nih.gov/books/NBK279684/table/appendices.T.options_common_to_all_blast/),我們可以選擇不同的輸出格式 outfmt: | 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) | | 12 | Seqalign (JSON) | | 13 | Multiple-file BLAST JSON | | 14 | Multiple-file BLAST XML2 | | 15 | Single-file BLAST JSON | | 16 | Single-file BLAST XML2 | | 17 | Sequence Alignment/Map (SAM) | | 18 | Organism Report | 如果使用的是 outfmt 6, 7 或 10,以下這些是可已自行選擇加入的參數: | 參數 | 解釋 | | -------- | -------- | | qseqid | Query Seq-id | | qgi | Query GI | | qacc | Query accesion | | qaccver | Query accesion.version | | qlen | Query sequence length | | sseqid | Subject Seq-id | | sallseqid | All subject Seq-id(s), separated by a ';' | | sgi | Subject GI | | sallgi | All subject GIs | | sacc | Subject accession | | saccver | Subject accession.version | | sallacc | All subject accessions | | slen | Subject sequence length | | qstart | Start of alignment in query | | qend | End of alignment in query | | sstart | Start of alignment in subject | | send | End of alignment in subject | | qseq | Aligned part of query sequence | | sseq | Aligned part of subject sequence | | evalue | Expect value | | bitscore | Bit score | | score | Raw score | | length | Alignment length | | pident | Percentage of identical matches | | nident | Number of identical matches | | mismatch | Number of mismatches | | positive | Number of positive-scoring matches | | gapopen | Number of gap openings | | gaps | Total number of gaps | | ppos | Percentage of positive-scoring matches | | frames | Query and subject frames separated by a '/' | | qframe | Query frame | | sframe | Subject frame | | btop | Blast traceback operations (BTOP) | | staxids | Subject Taxonomy ID(s), separated by a ';' | | sscinames | Subject Scientific Name(s), separated by a ';' | | scomnames | Subject Common Name(s), separated by a ';' | | sblastnames | Subject Blast Name(s), separated by a ';' (in alphabetical order) | | sskingdoms | Subject Super Kingdom(s), separated by a ';' (in alphabetical order) | | stitle | Subject Title | | salltitles | All Subject Title(s), separated by a '<>' | | sstrand | Subject Strand | | qcovs | Query Coverage Per Subject | | qcovhsp | Query Coverage Per HSP | 以上是在本機使用 BLAST+ 工具進行序列的線上比對流程筆記;而取得大量序列資料與自建本機資料庫,另外再來談。 <span style="font-size:30px">🐕‍🦺</span> 2022.11.08

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully